pub struct Floor {
pub width: usize,
pub height: usize,
pub stairs: (i32, i32),
pub units: Vec<Unit>,
}
Expand description
Each level has a Floor
with a predefined width
and height
,
stairs
positioned at the exit, and one or more units
. There
is a player-controlled Warrior
unit
for every level.
Fields§
§width: usize
the east/west count of tiles
height: usize
the north/south count of tiles
stairs: (i32, i32)
the position (x, y) of the exit
units: Vec<Unit>
all of the units that the level contains
Implementations§
Source§impl Floor
impl Floor
Sourcepub fn load(level: usize) -> Floor
pub fn load(level: usize) -> Floor
Returns the predefined configuration for a given level
number.
Sourcepub fn exists(level: usize) -> bool
pub fn exists(level: usize) -> bool
Returns true
if a configuration exists for a given level
number.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Floor
impl RefUnwindSafe for Floor
impl Send for Floor
impl Sync for Floor
impl Unpin for Floor
impl UnwindSafe for Floor
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