Struct eos_rs::ffi::entity

source ·
#[repr(C)]
pub struct entity {
Show 130 fields pub type_: Type, pub pos: position, pub prev_pos: position, pub pixel_x_shifted: c_int, pub pixel_y_shifted: c_int, pub pixel_x_shifted_mirror: c_int, pub pixel_y_shifted_mirror: c_int, pub elevation: c_int, pub is_visible: bool_, pub field_0x21: undefined, pub transparent: bool_, pub end_walk_anim_frame: u8, pub field_0x24: undefined, pub room_idx: u8, pub spawn_genid: u16, pub field_0x28: undefined, pub field_0x29: undefined, pub field_0x2a: undefined, pub field_0x2b: undefined, pub field_0x2c: undefined, pub field_0x2d: undefined, pub field_0x2e: undefined, pub field_0x2f: undefined, pub field_0x30: undefined, pub field_0x31: undefined, pub field_0x32: undefined, pub field_0x33: undefined, pub field_0x34: undefined, pub field_0x35: undefined, pub field_0x36: undefined, pub field_0x37: undefined, pub idle_anim_frame: u8, pub field_0x39: undefined, pub field_0x3a: undefined, pub field_0x3b: undefined, pub field_0x3c: undefined, pub field_0x3d: undefined, pub field_0x3e: undefined, pub field_0x3f: undefined, pub field_0x40: undefined, pub field_0x41: undefined, pub field_0x42: undefined, pub field_0x43: undefined, pub field_0x44: undefined, pub field_0x45: undefined, pub field_0x46: undefined, pub field_0x47: undefined, pub field_0x48: undefined, pub field_0x49: undefined, pub field_0x4a: undefined, pub field_0x4b: undefined, pub pixel_offset: position, pub shadow_offset: position, pub field_0x54: undefined, pub field_0x55: undefined, pub field_0x56: undefined, pub field_0x57: undefined, pub field_0x58: undefined, pub field_0x59: undefined, pub field_0x5a: undefined, pub field_0x5b: undefined, pub field_0x5c: undefined, pub field_0x5d: undefined, pub field_0x5e: undefined, pub field_0x5f: undefined, pub field_0x60: undefined, pub field_0x61: undefined, pub field_0x62: undefined, pub field_0x63: undefined, pub field_0x64: undefined, pub field_0x65: undefined, pub sprite_id: u16, pub sprite_id_mirror: u16, pub field_0x6a: undefined, pub field_0x6b: undefined, pub field_0x6c: undefined, pub field_0x6d: undefined, pub field_0x6e: undefined, pub field_0x6f: undefined, pub field_0x70: undefined, pub field_0x71: undefined, pub field_0x72: undefined, pub field_0x73: undefined, pub field_0x74: *mut c_void, pub field_0x78: *mut c_void, pub field_0x7c: *mut c_void, pub field_0x80: *mut c_void, pub field_0x84: *mut c_void, pub field_0x88: *mut c_void, pub field_0x8c: undefined, pub field_0x8d: undefined, pub field_0x8e: undefined, pub field_0x8f: undefined, pub field_0x90: undefined, pub field_0x91: undefined, pub field_0x92: undefined, pub field_0x93: undefined, pub field_0x94: undefined, pub field_0x95: undefined, pub field_0x96: undefined, pub field_0x97: undefined, pub field_0x98: undefined, pub field_0x99: undefined, pub field_0x9a: undefined, pub field_0x9b: undefined, pub field_0x9c: undefined, pub field_0x9d: undefined, pub field_0x9e: undefined, pub field_0x9f: undefined, pub field_0xa0: undefined, pub field_0xa1: undefined, pub field_0xa2: undefined, pub field_0xa3: undefined, pub graphical_direction_mirror1: direction_id_8, pub field_0xa5: undefined, pub field_0xa6: undefined, pub field_0xa7: undefined, pub field_0xa8: undefined, pub field_0xa9: undefined, pub field_0xaa: undefined, pub field_0xab: undefined, pub field_0xac: undefined, pub field_0xad: undefined, pub anim_id: u8, pub anim_id_mirror: u8, pub graphical_direction: direction_id_8, pub graphical_direction_mirror0: direction_id_8, pub field_0xb2: undefined, pub field_0xb3: undefined, pub info: *mut c_void,
}

Fields§

§type_: Type§pos: position§prev_pos: position§pixel_x_shifted: c_int§pixel_y_shifted: c_int§pixel_x_shifted_mirror: c_int§pixel_y_shifted_mirror: c_int§elevation: c_int§is_visible: bool_§field_0x21: undefined§transparent: bool_§end_walk_anim_frame: u8§field_0x24: undefined§room_idx: u8§spawn_genid: u16§field_0x28: undefined§field_0x29: undefined§field_0x2a: undefined§field_0x2b: undefined§field_0x2c: undefined§field_0x2d: undefined§field_0x2e: undefined§field_0x2f: undefined§field_0x30: undefined§field_0x31: undefined§field_0x32: undefined§field_0x33: undefined§field_0x34: undefined§field_0x35: undefined§field_0x36: undefined§field_0x37: undefined§idle_anim_frame: u8§field_0x39: undefined§field_0x3a: undefined§field_0x3b: undefined§field_0x3c: undefined§field_0x3d: undefined§field_0x3e: undefined§field_0x3f: undefined§field_0x40: undefined§field_0x41: undefined§field_0x42: undefined§field_0x43: undefined§field_0x44: undefined§field_0x45: undefined§field_0x46: undefined§field_0x47: undefined§field_0x48: undefined§field_0x49: undefined§field_0x4a: undefined§field_0x4b: undefined§pixel_offset: position§shadow_offset: position§field_0x54: undefined§field_0x55: undefined§field_0x56: undefined§field_0x57: undefined§field_0x58: undefined§field_0x59: undefined§field_0x5a: undefined§field_0x5b: undefined§field_0x5c: undefined§field_0x5d: undefined§field_0x5e: undefined§field_0x5f: undefined§field_0x60: undefined§field_0x61: undefined§field_0x62: undefined§field_0x63: undefined§field_0x64: undefined§field_0x65: undefined§sprite_id: u16§sprite_id_mirror: u16§field_0x6a: undefined§field_0x6b: undefined§field_0x6c: undefined§field_0x6d: undefined§field_0x6e: undefined§field_0x6f: undefined§field_0x70: undefined§field_0x71: undefined§field_0x72: undefined§field_0x73: undefined§field_0x74: *mut c_void§field_0x78: *mut c_void§field_0x7c: *mut c_void§field_0x80: *mut c_void§field_0x84: *mut c_void§field_0x88: *mut c_void§field_0x8c: undefined§field_0x8d: undefined§field_0x8e: undefined§field_0x8f: undefined§field_0x90: undefined§field_0x91: undefined§field_0x92: undefined§field_0x93: undefined§field_0x94: undefined§field_0x95: undefined§field_0x96: undefined§field_0x97: undefined§field_0x98: undefined§field_0x99: undefined§field_0x9a: undefined§field_0x9b: undefined§field_0x9c: undefined§field_0x9d: undefined§field_0x9e: undefined§field_0x9f: undefined§field_0xa0: undefined§field_0xa1: undefined§field_0xa2: undefined§field_0xa3: undefined§graphical_direction_mirror1: direction_id_8§field_0xa5: undefined§field_0xa6: undefined§field_0xa7: undefined§field_0xa8: undefined§field_0xa9: undefined§field_0xaa: undefined§field_0xab: undefined§field_0xac: undefined§field_0xad: undefined§anim_id: u8§anim_id_mirror: u8§graphical_direction: direction_id_8§graphical_direction_mirror0: direction_id_8§field_0xb2: undefined§field_0xb3: undefined§info: *mut c_void

Implementations§

source§

impl entity

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.

Auto Trait Implementations§

§

impl RefUnwindSafe for entity

§

impl !Send for entity

§

impl !Sync for entity

§

impl Unpin for entity

§

impl UnwindSafe for entity

Blanket Implementations§

§

impl<T> Any for Twhere T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dstwhere T: Cast<Dst>,

Casts the value.
§

impl<T> Borrow<T> for Twhere T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dstwhere Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for Twhere U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

source§

impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Srcwhere Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.