[−][src]Struct rust_warrior::floor::Floor
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
level: usizewhich level
width: usizethe east/west count of tiles
height: usizethe 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
Methods
impl Floor[src]
pub fn load(level: usize) -> Floor[src]
Returns the predefined configuration for a given level number.
pub fn exists(level: usize) -> bool[src]
Returns true if a configuration exists for a given level number.
pub fn tile(&self, position: (i32, i32)) -> Tile[src]
Returns a Tile representing the current state of a tile
of the floor at position.
pub fn draw(&self)[src]
Prints a textual representation of the floor and all of its units.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Floor
impl Send for Floor
impl Sync for Floor
impl Unpin for Floor
impl UnwindSafe for Floor
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Resource for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,