[][src]Struct rust_warrior::floor::Floor

pub struct Floor {
    pub level: usize,
    pub width: usize,
    pub height: usize,
    pub stairs: (i32, i32),
    pub units: Vec<Unit>,
}

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: usize

which level

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

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

impl Clone for Floor[src]

impl Debug for Floor[src]

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]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.