pub struct FloorMap {
pub width: usize,
pub height: usize,
pub tiles: Vec<Tile>,
pub rooms: Vec<DungeonRoom>,
pub corridors: Vec<DungeonCorridor>,
pub player_start: IVec2,
pub exit_point: IVec2,
pub biome: FloorBiome,
pub floor_number: u32,
}Expand description
The full tile map for a single floor.
Fields§
§width: usize§height: usize§tiles: Vec<Tile>§rooms: Vec<DungeonRoom>§corridors: Vec<DungeonCorridor>§player_start: IVec2§exit_point: IVec2§biome: FloorBiome§floor_number: u32Implementations§
Source§impl FloorMap
impl FloorMap
Sourcepub fn get_tile(&self, x: i32, y: i32) -> Tile
pub fn get_tile(&self, x: i32, y: i32) -> Tile
Get the tile at (x, y), or Wall if out of bounds.
Sourcepub fn room_at(&self, pos: IVec2) -> Option<&DungeonRoom>
pub fn room_at(&self, pos: IVec2) -> Option<&DungeonRoom>
Find which room contains the given position.
Sourcepub fn room_at_mut(&mut self, pos: IVec2) -> Option<&mut DungeonRoom>
pub fn room_at_mut(&mut self, pos: IVec2) -> Option<&mut DungeonRoom>
Find which room contains the given position (mutable).
Sourcepub fn walkable_neighbors(&self, pos: IVec2) -> Vec<IVec2>
pub fn walkable_neighbors(&self, pos: IVec2) -> Vec<IVec2>
Return all walkable neighbor positions of pos.
Sourcepub fn tile_count(&self) -> usize
pub fn tile_count(&self) -> usize
Total number of tiles.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FloorMap
impl RefUnwindSafe for FloorMap
impl Send for FloorMap
impl Sync for FloorMap
impl Unpin for FloorMap
impl UnsafeUnpin for FloorMap
impl UnwindSafe for FloorMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.