Struct map_gen_2d::bsp::BSPMap

source ·
pub struct BSPMap { /* private fields */ }
Expand description

Map generated with binary search partitioning. The map must have a size of atleast (20,20).

Credit to https://gamedevelopment.tutsplus.com/tutorials/how-to-use-bsp-trees-to-generate-game-maps–gamedev-12268 and https://github.com/whostolemyhat/dungeon for algorithm and rust implementation help.

Implementations§

Examples found in repository?
examples/bsp-map.rs (line 4)
3
4
5
6
fn main() {
    let map = BSPMap::new(Point::new(30,50), SeedableRng::seed_from_u64(1), Point::new(3,5), Point::new(10,15)).unwrap();
    println!("{}", map);
}

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.