grid-map
This library provides two-dimensional grid maps.
There is support for square and hexagonal grids as well as multiple coordinate integer sizes.
Features
You must choose the scale and grid type, or use the default.
Map Configuration Examples:
# 32-bit square map
= "0.1.0-rc.2"
# 16-bit hexagonal map (with flat tops)
= { = "grid-map", = "0.1.0-rc.2", = ["scale-16", "hex-flat"] }
# 8-bit hexagonal map with pointy tops
= { = "grid-map", = "0.1.0-rc.2", = ["scale-8", "hex-pointy"] }
Scale (mutually exclusive, default: scale-32)
scale-8--u8coordinatesscale-16--u16coordinatesscale-32--u32coordinates
Grid Type (mutually exclusive, default: square)
square-- 4 directions (North, East, South, West)hex-flat-- 6 directions, flat-top hex (North, NorthEast, SouthEast, South, SouthWest, NorthWest)hex-pointy-- 6 directions, pointy-top hex (NorthEast, East, SouthEast, SouthWest, West, NorthWest)
Types
Scale-- the coordinate type (u8,u16, oru32)Dim-- grid dimensions (width, height)Loc-- grid location (x, y)Dir-- cardinal directions (varies by grid type)GridMap<T>-- a two-dimensional grid map