Type Definition eos_rs::api::dungeon_mode::DungeonTile

source ·
pub type DungeonTile = tile;
Expand description

A struct representing a single dungeon tile.

Implementations§

source§

impl DungeonTile

Important safety note

Please see the safety note of DungeonEntity. It also applies to this impl.

source

pub fn init(&mut self)

Initializes the tile struct.

source

pub fn get_terrain(&self) -> Option<TerrainType>

Gets the terrain type of a tile. Returns None if the terrain type is invalid.

source

pub fn set_terrain_obstacle_checked( &mut self, secondary_terrain: bool, room_index: u8 )

Set the terrain of a specific tile to be an obstacle (wall or secondary terrain).

If secondary_terrain is true, secondary terrain will be placed, otherwise wall.

Secondary terrain (water/lava) can only be placed in the specified room. If the tile room index does not match, a wall will be placed instead.

source

pub fn set_secondary_terrain_on_wall(&mut self)

Set a specific tile to have secondary terrain (water/lava), but only if it’s a passable wall.

source

pub fn bind_trap(&mut self, trap: &mut DungeonEntity, is_visible: bool)

Sets this tile’s associated object to be the given trap, and sets the visibility of the trap.