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

Returns the predefined configuration for a given level number.

Returns true if a configuration exists for a given level number.

Returns a Tile representing the current state of a tile of the floor at position.

Prints a textual representation of the floor and all of its units.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. 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.