Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 18 variants SetCount { profession: usize, count: i32, }, AddWorker { entity: usize, }, RemoveWorker { entity: usize, }, ChangeMaxWorkers { entity: usize, delta: i32, }, SetEnabled { entity: usize, enabled: bool, }, SetCrop { entity: usize, crop: Option<usize>, }, FieldAction { entity: usize, action: i32, }, SetLimit { entity: usize, limit: i32, }, Demolish { entity: usize, }, CancelDemolition { entity: usize, }, PlanRoad { cell: i32, kind: u8, ty: u8, material: Option<usize>, }, ClearRoad { cell: i32, marker: usize, }, StateMessage { entity: usize, message: i32, }, Control { entity: usize, kind: u32, index: i32, }, SetRecipe { entity: usize, recipe: i32, }, Upgrade { entity: usize, template: usize, }, Exchange { entity: usize, sell: Vec<(usize, i32)>, buy: Vec<(usize, i32)>, }, Trade { entity: usize, setting: TradeSetting, },
}
Expand description

A player action on professions, applied by the simulation.

Variants§

§

SetCount

ProfessionUI spinner 300 + profession set to count.

Original: FUN_14007b890.

Fields

§profession: usize

The profession.

§count: i32

The number of workers wanted.

§

AddWorker

WorkPlaceUI 0x1450: one more worker of the workplace’s profession.

Original: FUN_1400918a0.

Fields

§entity: usize

The workplace.

§

RemoveWorker

WorkPlaceUI 0x1451: one fewer.

Original: FUN_140096650.

Fields

§entity: usize

The workplace.

§

ChangeMaxWorkers

WorkPlaceUI 0x1452/0x1453: most workers ± 1.

Original: FUN_14008cae0, FUN_140134fd0.

Fields

§entity: usize

The workplace.

§delta: i32

The change: +1 or −1.

§

SetEnabled

The pause button of a building’s window (element 6000).

Original: FUN_1400b7370, FUN_1401350d0.

Fields

§entity: usize

The building.

§enabled: bool

Whether it works.

§

SetCrop

CropUI’s crop list: the field’s crop; choosing the first one switches farming on.

Original: FUN_1400b7df0.

Fields

§entity: usize

The field.

§crop: Option<usize>

The crop, or none.

§

FieldAction

The field’s buttons: 0 plant now, 1 harvest now, 2 farming on/off.

Original: FUN_140120190.

Fields

§entity: usize

The field.

§action: i32

The button: 0, 1 or 2.

§

SetLimit

PastureUI’s slider: the most animals the pasture keeps.

Original: FUN_1400ba2f0.

Fields

§entity: usize

The pasture.

§limit: i32

The most animals.

§

Demolish

Demolish a building (the Remove Buildings tool, or the button in its window).

Original: FUN_140109b40, FUN_140123470.

Fields

§entity: usize

The building.

§

CancelDemolition

DestroyUI 0x1771: the demolition is called off.

Original: FUN_1401238d0.

Fields

§entity: usize

The building.

§

PlanRoad

RoadTool’s apply: plan a road on a cell.

Original: FUN_14010a200, FUN_1400a1e30.

Fields

§cell: i32

The cell.

§kind: u8

The road kind.

§ty: u8

The cell type of the road.

§material: Option<usize>

The raw material it is built from, if any.

§

ClearRoad

Remove Roads: take a planned road back; a built one gets a removal marker (marker, the tool’s template).

Original: FUN_140108ab0, FUN_1400a1bd0.

Fields

§cell: i32

The cell.

§marker: usize

The removal marker’s template.

§

StateMessage

A StateMachine message: DestroyComponent’s Remove Cancel (0 while torn down), DestroyUI 0x1772 (0: rebuild the rubble) and 0x1773 (1: clear it); ImmigrationUI 0x9858 (7: take the nomads in) and 0x9859 (8: turn them away).

Original: FUN_140123940, FUN_1401239a0.

Fields

§entity: usize

The entity.

§message: i32

The message.

§

Control

ControlUI: the kind component’s control index.

Original: FUN_140060150.

Fields

§entity: usize

The entity.

§kind: u32

The component kind.

§index: i32

The control’s index.

§

SetRecipe

ConsumeProduceUI’s product: ConsumeProduceComponent.

Original: FUN_14005fc90.

Fields

§entity: usize

The workplace.

§recipe: i32

The product.

§

Upgrade

Upgrade a building to template (the upgrade button): it is demolished, and the new building takes its place.

Original: FUN_14008c160, then FUN_140123470.

Fields

§entity: usize

The building.

§template: usize

The template of the new building.

§

Exchange

TradeUI’s trade button: sell (material, count) and buy (trade good, count).

Original: FUN_1400868f0.

Fields

§entity: usize

The trading post.

§sell: Vec<(usize, i32)>

What the town sells: (raw material, count).

§buy: Vec<(usize, i32)>

What the town buys: (trade good, count).

§

Trade

TradeUI’s settings on the TradeComponent.

Fields

§entity: usize

The trading post.

§setting: TradeSetting

The setting.

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

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 Command

Source§

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

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

impl<'de> Deserialize<'de> for Command

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Command

Source§

impl PartialEq for Command

Source§

fn eq(&self, other: &Command) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Command

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Command

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.