grid-map 0.1.0-rc.1

This library provides two-dimensional grid maps.
Documentation
  • Coverage
  • 40%
    6 out of 15 items documented0 out of 0 items with examples
  • Size
  • Source code size: 30.8 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.18 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • nikdeapen/grid-map
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • nikdeapen

grid-map

Crates.io Docs.rs License: MIT

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
grid-map = "0.1.0-rc.1"

# 16-bit hexagonal map (with flat tops)
world-map = { package = "grid-map", version = "0.1.0-rc.1", features = ["scale-16", "hex-flat"] }

# 8-bit hexagonal map with pointy tops
city-map = { package = "grid-map", version = "0.1.0-rc.1", features = ["scale-8", "hex-pointy"] } 

Scale (mutually exclusive, default: scale-32)

  • scale-8 -- u8 coordinates
  • scale-16 -- u16 coordinates
  • scale-32 -- u32 coordinates

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, or u32)
  • Dim -- grid dimensions (width, height)
  • Loc -- grid location (x, y)
  • Dir -- cardinal directions (varies by grid type)
  • GridMap<T> -- a two-dimensional grid map