Crate mapgen[][src]

Expand description

Generators for dungeon type maps.

Generators can bu used directly or they can be combined with MapGenerators and MapModifiers

  • MapGenerators are use to create initial map.
  • MapModifiers modify existing map.


use mapgen::{MapFilter, MapBuilder, Map, Tile};
use mapgen::filter::{
    starting_point::{AreaStartingPosition, XStart, YStart}
use mapgen::geometry::Point;
let map = MapBuilder::new(80, 50)
            .with(AreaStartingPosition::new(XStart::CENTER, YStart::CENTER))
assert_eq!(map.width, 80);
assert_eq!(map.height, 50);
assert_eq!(map.starting_point.is_some(), true);


pub use map::Map;
pub use map::Symmetry;
pub use map::Tile;
pub use filter::*;


Generators for dungeon type maps.

Support function for 2D geometry

Map structure contains information about tiles and other elements on the map.

Different metrics for the map Can be used to meausre the quality of the map or the quality of the generator. To meause the quality of the generator; generate lots of maps, measure them and the provide generator score as an average.


Used to chain MapBuilder and MapModifiers to create the final map.


Trait which should be implemented by map modifier. Modifier takes initiall map and apply changes to it.