Type Definition eos_rs::api::dungeon_mode::DungeonEntity
source · pub type DungeonEntity = entity;
Expand description
Entity in a dungeon. Has a DungeonEntityType
.
Implementations§
source§impl DungeonEntity
impl DungeonEntity
Important safety note
These implementations can assume that overlay 29 is loaded (since this is the only context dungeon entities are actually relevant). If you somehow manually construct types of this struct for some reason, you NEED to make sure overlay 29 is loaded when using some f unctions of this trait. The methods in this impl are marked safe for convenience, since in its intended use case, overlay 29 will always be loaded.
sourcepub fn entity_type(&self) -> Option<DungeonEntityType>
pub fn entity_type(&self) -> Option<DungeonEntityType>
Entity type. Invalid values will return None.
sourcepub fn info_for_monster(&self) -> Option<DungeonMonsterRef<'_>>
pub fn info_for_monster(&self) -> Option<DungeonMonsterRef<'_>>
This returns the monster info struct for the entity, returns None if the entity is not a monster.
sourcepub fn info_for_item(&self) -> Option<&Item>
pub fn info_for_item(&self) -> Option<&Item>
This returns the item info struct for the entity, returns None if the entity is not an item.
sourcepub fn info_for_trap(&self) -> Option<&DungeonTrap>
pub fn info_for_trap(&self) -> Option<&DungeonTrap>
This returns the trap info struct for the entity, returns None if the entity is not a trap.
sourcepub fn info_for_monster_mut(&mut self) -> Option<DungeonMonsterMut<'_>>
pub fn info_for_monster_mut(&mut self) -> Option<DungeonMonsterMut<'_>>
This returns the monster info struct for the entity, returns None if the entity is not a monster.
sourcepub fn info_for_item_mut(&mut self) -> Option<&mut Item>
pub fn info_for_item_mut(&mut self) -> Option<&mut Item>
This returns the item info struct for the entity, returns None if the entity is not an item.
sourcepub fn info_for_trap_mut(&mut self) -> Option<&mut DungeonTrap>
pub fn info_for_trap_mut(&mut self) -> Option<&mut DungeonTrap>
This returns the trap info struct for the entity, returns None if the entity is not a trap.
sourcepub fn get_tile(&self) -> Option<&DungeonTile>
pub fn get_tile(&self) -> Option<&DungeonTile>
Returns the tile, that the entity is located at.
sourcepub fn get_tile_mut(&mut self) -> Option<&mut DungeonTile>
pub fn get_tile_mut(&mut self) -> Option<&mut DungeonTile>
Returns the tile, that the entity is located at.