Trait eos_rs::api::dungeon_mode::DungeonTileGridWrite
source · 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§
sourcefn get_mut(&mut self, x: usize, y: usize) -> Option<&mut DungeonTile>
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.
sourcefn insert(&mut self, x: usize, y: usize, tile: DungeonTile)
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.
sourcefn iter_mut(&mut self) -> DungeonTileGridIterMut<'_, W> ⓘ
fn iter_mut(&mut self) -> DungeonTileGridIterMut<'_, W> ⓘ
Iterate over all tiles in the grid, in row-major order (from top-left to bottom-right).