pub struct NpcRuntimeState {Show 17 fields
pub npc_index: u8,
pub sprite_id: u8,
pub x: u16,
pub y: u16,
pub home_x: u16,
pub home_y: u16,
pub facing: Direction,
pub scripted_frame: Option<u8>,
pub movement_type: NpcMovementType,
pub wander_axis: NpcWanderAxis,
pub range: u8,
pub walk_counter: u8,
pub delay_counter: u8,
pub text_id: u8,
pub defeated: bool,
pub visible: bool,
pub scripted_path: VecDeque<(u16, u16)>,
}Expand description
Runtime state for a single NPC on the current map.
Game-specific data (e.g., trainer flags, item drops) should be stored
in a separate parallel array and looked up by npc_index.
Fields§
§npc_index: u8§sprite_id: u8§x: u16§y: u16§home_x: u16§home_y: u16§facing: Direction§scripted_frame: Option<u8>§movement_type: NpcMovementType§wander_axis: NpcWanderAxisAxis restriction for Wander NPCs (classic GB movement byte 2).
range: u8§walk_counter: u8§delay_counter: u8§text_id: u8§defeated: bool§visible: bool§scripted_path: VecDeque<(u16, u16)>Trait Implementations§
Source§impl Clone for NpcRuntimeState
impl Clone for NpcRuntimeState
Source§fn clone(&self) -> NpcRuntimeState
fn clone(&self) -> NpcRuntimeState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NpcRuntimeState
impl Debug for NpcRuntimeState
Source§impl<'de> Deserialize<'de> for NpcRuntimeState
impl<'de> Deserialize<'de> for NpcRuntimeState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NpcRuntimeState
impl RefUnwindSafe for NpcRuntimeState
impl Send for NpcRuntimeState
impl Sync for NpcRuntimeState
impl Unpin for NpcRuntimeState
impl UnsafeUnpin for NpcRuntimeState
impl UnwindSafe for NpcRuntimeState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more