Skip to main content

Action

Enum Action 

Source
pub enum Action {
Show 17 variants MoveTo(Box<MoveTo>), PlayAnimation { anim: usize, duration: i64, elapsed: i64, }, PerformWork { facing: f32, anim: usize, duration: i64, elapsed: i64, consume: bool, }, SendMessage(Message), CompleteRoad { cell: i32, ty: u8, built: u8, }, ConsumeStoredRawMaterial { storage: usize, items: Vec<(usize, i32)>, reserved: bool, }, PickupStoredRawMaterial { storage: usize, items: Vec<(usize, i32)>, partial: bool, }, ShowTool(i32), CompleteTask { work: i32, param: i32, }, AnimateResource { entity: usize, anim: usize, wait: bool, }, RemoveResource { entity: usize, flag: bool, }, PickupPile { entity: usize, }, CreateRawMaterial { template: usize, cell: i32, batch: i32, workplace: Option<usize>, factor: f32, }, HuntAnimal { lodge: usize, done: bool, }, RemoveAnimal { entity: usize, }, CreateNaturalResource { template: usize, occupant: Option<usize>, cell: i32, }, DropOff { storage: usize, material: usize, count: i32, redirect: bool, },
}
Expand description

One task.

Variants§

§

MoveTo(Box<MoveTo>)

MoveTo: walk to a target.

§

PlayAnimation

PlayAnimation: play anim for duration.

Fields

§anim: usize

The clip.

§duration: i64

How long it plays, in microseconds.

§elapsed: i64

The time played so far.

§

PerformWork

PerformWork: face facing (if within ±180), play anim for duration.

Fields

§facing: f32

The heading to face, in degrees.

§anim: usize

The work clip.

§duration: i64

How long the work takes, in microseconds.

§elapsed: i64

The time worked so far.

§consume: bool

Decrement the citizen’s counter on start.

§

SendMessage(Message)

SendComponentMessage: deliver a message on start.

§

CompleteRoad

CompleteRoad: the cell becomes its road (or ground) on start.

Original: FUN_1400caea0.

Fields

§cell: i32

The cell.

§ty: u8

The cell type it gets.

§built: u8

The road kind built there.

§

ConsumeStoredRawMaterial

Reserve at construction; consume on start.

Original: FUN_1400cb880, FUN_1400cb980.

Fields

§storage: usize

The storage.

§items: Vec<(usize, i32)>

What it uses: (raw material, count).

§reserved: bool

Whether the goods were reserved.

§

PickupStoredRawMaterial

Reserve at construction; transfer on start.

Original: FUN_1400cf9f0, FUN_1400cf700.

Fields

§storage: usize

The storage.

§items: Vec<(usize, i32)>

What it takes: (raw material, count).

§partial: bool

Whether it may take less than asked.

§

ShowTool(i32)

ShowTool: attach tool mesh n (0..10), the carried goods (−2), or nothing (−1). The town draws it on the citizen’s tool node (StartingTown::model_instances).

Original: FUN_140043070, FUN_14011c880.

§

CompleteTask

CompleteTask: tell the job manager the task is done or abandoned.

Original: FUN_1400cb270, FUN_1400cb010; abandoned FUN_1400caf90.

Fields

§work: i32

The work’s id.

§param: i32

The task’s parameter.

§

AnimateResource

AnimateNaturalResource: play the resource’s animation anim; with wait, run until it ends.

Original: FUN_1400caca0, FUN_1400caad0, FUN_1400caa80.

Fields

§entity: usize

The resource.

§anim: usize

The clip.

§wait: bool

Whether the action waits until the clip ends.

§

RemoveResource

RemoveNaturalResource: remove the resource and leave its pile; abort releases the claim (flag 0x100000).

Original: FUN_1400d02c0, FUN_1400cffe0, FUN_1400cff70.

Fields

§entity: usize

The resource.

§flag: bool

The removal flag passed to the resource.

§

PickupPile

PickupRawMaterial: take the whole pile into the carried storage and destroy it.

Original: FUN_1400cf040, FUN_1400ceda0.

Fields

§entity: usize

The pile.

§

CreateRawMaterial

CreateRawMaterial: leave the output as piles near cell, batch weight each (the worker’s capacity).

Original: FUN_1400cc670, FUN_1400cc010.

Fields

§template: usize

The template of the output piles.

§cell: i32

The cell they are left near.

§batch: i32

The weight of each pile.

§workplace: Option<usize>

The workplace that made them.

§factor: f32

The yield is scaled by this (1 for production; a dock’s share of the fish).

§

HuntAnimal

HuntAnimal, attached to a hunter’s walk or wait: running until its notify (run by the citizens’ update) has started an attack.

Original: FUN_1400cd8d0, FUN_1400cd2b0.

Fields

§lodge: usize

The hunter’s lodge.

§done: bool

Whether the attack has started.

§

RemoveAnimal

RemoveAnimal.

Original: FUN_1400cfcc0.

Fields

§entity: usize

The animal.

§

CreateNaturalResource

CreateNaturalResource: plant template on cell, which must hold no object and occupant as its occupant.

Original: FUN_1400cbef0.

Fields

§template: usize

The resource’s template.

§occupant: Option<usize>

The cell’s required occupant.

§cell: i32

The cell.

§

DropOff

DropOffRawMaterial: move up to count carried units into storage; with redirect a storage that cannot take them sends the citizen on to another, or the goods are left on the ground.

Original: FUN_1400cd1a0, FUN_1400cc7d0.

Fields

§storage: usize

The storage.

§material: usize

The raw material.

§count: i32

The most units to move.

§redirect: bool

Whether a storage that cannot take them sends the citizen on.

Implementations§

Source§

impl Action

Source

pub fn move_to(m: MoveTo) -> Action

A MoveTo action.

Trait Implementations§

Source§

impl Clone for Action

Source§

fn clone(&self) -> Action

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 Action

Source§

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

Formats the value using the given formatter. 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.