Struct cell_map::CellMap[][src]

pub struct CellMap<L, T> where
    L: Layer
{ /* fields omitted */ }
Expand description

Provides a many-layer 2D map of cellular data.

Implementations

Returns the size of the cells in the map.

Returns the number of cells in each direction of the map.

Returns whether or not the given index is inside the map.

Get a reference to the value at the given layer and index. Returns None if the index is outside the bounds of the map.

Get a reference to the value at the given layer and index, without checking the bounds of the map.

Safety

This function will panic if index is outside the map.

Get a mutable reference to the value at the given layer and index. Returns None if the index is outside the bounds of the map.

Get a mutable reference to the value at the given layer and index, without checking the bounds of the map.

Safety

This function will panic if index is outside the map.

Returns an iterator over each cell in all layers of the map.

Returns a mutable iterator over each cell in all layers of the map.

Returns an iterator over windows of cells in the map.

The semi_width is half the size of the window in the x and y axes, not including the central cell. E.g. to have a window which is in total 5x5, the semi_window_size needs to be Vector2::new(2, 2).

Returns a mutable iterator over windows of cells in the map.

The semi_width is half the size of the window in the x and y axes, not including the central cell. E.g. to have a window which is in total 5x5, the semi_window_size needs to be Vector2::new(2, 2).

Creates a new CellMap from the given params, filling each cell with elem.

Creates a new CellMap from the given params, filling each cell with T::default().

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

Deserialize this value from the given Serde deserializer. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Serialize this value into the given Serde serializer. 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

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.