Expand description

Add starting point to the map

This modifier will try to add starting point by finding the floor title closes to the given point.

Example modifier usage:

use rand::prelude::*;
use mapgen::{MapFilter, MapBuffer};
use mapgen::filter::starting_point::{AreaStartingPosition, XStart, YStart};
use mapgen::geometry::Point;
 
let mut rng = StdRng::seed_from_u64(100);
let mut map = MapBuffer::new(80, 50);
map.set_walkable(10, 10, true);
let modifier = AreaStartingPosition::new(XStart::LEFT, YStart::TOP);
let new_map = modifier.modify_map(&mut rng, &map);
 
assert_eq!(new_map.starting_point, Some(Point::new(10, 10)));

Structs

Add starting position to the map

Enums

Initial x region position
Initial y region position