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

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.

source

pub fn is_valid(slf: *mut Self) -> bool

Checks if a given entity is actually valid.

source

pub fn entity_type(&self) -> Option<DungeonEntityType>

Entity type. Invalid values will return None.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn get_tile(&self) -> Option<&DungeonTile>

Returns the tile, that the entity is located at.

source

pub fn get_tile_mut(&mut self) -> Option<&mut DungeonTile>

Returns the tile, that the entity is located at.