pub trait DungeonTileGridWrite<const W: usize, const H: usize>: DungeonTileGridRead<W, H> {
    // Required methods
    fn get_mut(&mut self, x: usize, y: usize) -> Option<&mut DungeonTile>;
    fn insert(&mut self, x: usize, y: usize, tile: DungeonTile);
    fn iter_mut(&mut self) -> DungeonTileGridIterMut<'_, W> ;
}
Expand description

Functions for writing into a tile grid.

Required Methods§

source

fn get_mut(&mut self, x: usize, y: usize) -> Option<&mut DungeonTile>

Returns the tile at the given position, mutably. Panics if the position is out of bounds.

source

fn insert(&mut self, x: usize, y: usize, tile: DungeonTile)

Place the given tile at the given position. This overwrites the data of the tile that is pointed to at this location. Panics if the position is out of bounds.

source

fn iter_mut(&mut self) -> DungeonTileGridIterMut<'_, W>

Iterate over all tiles in the grid, in row-major order (from top-left to bottom-right).

Implementors§

source§

impl<'a, const W: usize, const H: usize> DungeonTileGridWrite<W, H> for DungeonTileGridMut<'a, W, H>