Skip to main content

ActionStack

Struct ActionStack 

Source
pub struct ActionStack {
    pub outbox: Vec<Message>,
    /* private fields */
}
Expand description

The CharacterComponent’s task stack (top index) and its “on empty” chain.

Fields§

§outbox: Vec<Message>

Job-manager messages from aborted CompleteTasks, for the owner to deliver right after the clear.

Original: FUN_1400caf90.

Implementations§

Source§

impl ActionStack

Source

pub fn restored( entries: Vec<(Action, bool)>, on_empty: Option<Action>, ) -> ActionStack

A saved stack: its entries bottom to top, each one action and whether it started, and the “on empty” action. Actions linked to an entry are not saved.

Original: FUN_14010ef80.

Source

pub fn saved(&self) -> (Vec<(&Action, bool)>, Option<&Action>)

What a save holds: each entry’s first action with its started flag, and the “on empty” chain’s first action.

Original: FUN_14010ef80.

Source

pub fn depth(&self) -> usize

How many entries the stack holds.

Source

pub fn is_active(&self) -> bool

>= 0: something is queued (the AI’s “is busy” test).

Source

pub fn clear( &mut self, ch: &mut Character, group: &AnimationGroup, storages: &mut [Storage], )

Abort every chain (slot on all actions) and drop the “on empty” chain.

Original: FUN_1400ca8d0.

Source

pub fn pending_reservations(&self) -> Vec<(usize, usize, i32)>

The stored goods queued actions hold reserved: (storage, material, count) of each unstarted PickupStoredRawMaterial and reserving ConsumeStoredRawMaterial.

Source

pub fn holds_task(&self, work: i32) -> Option<i32>

Does a chain start with this work’s CompleteTask?

Original: FUN_1400fc5d0.

Source

pub fn attach(&mut self, action: Action)

Link action into the top chain (the original’s of the top action).

Source

pub fn hunt_watch(&mut self) -> Option<(usize, &mut bool)>

The top chain’s HuntAnimal, if any: its lodge and its done flag.

Source

pub fn notify_moves(&mut self, following: bool)

The scheduled notify: the running chain’s started actions get slot; MoveTo’s sets whether it follows.

Original: FUN_14010e950, FUN_1400ca450, FUN_1400cde40.

Source

pub fn set_on_empty(&mut self, actions: Vec<Action>)

Set the actions to run when the stack is empty.

Source

pub fn push( &mut self, ch: &mut Character, group: &AnimationGroup, action: Action, )

Stop the current top’s started actions, then push a chain.

Original: FUN_1400ca9b0.

Trait Implementations§

Source§

impl Clone for ActionStack

Source§

fn clone(&self) -> ActionStack

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActionStack

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ActionStack

Source§

fn default() -> ActionStack

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.