OrderOptions
What defineOrder takes.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Stage extends string |
string |
Refusal extends string |
never |
Properties
Section titled “Properties”Methods
Section titled “Methods”chooseWorker()?
Section titled “chooseWorker()?”
optionalchooseWorker(context):Entity|null
Which worker takes it, a game’s rule such as a skill or a priority:
an idle worker, or null for none, which refuses
OrderRefusal.NoFreeWorker.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context |
OrderChooseContext |
Returns
Section titled “Returns”Entity | null
Default Value
Section titled “Default Value”the idle worker nearest from, by findIdleWorker
plan()
Section titled “plan()”plan(
context):OrderStageOptions<NoInfer<Stage>> |NoInfer<Refusal> |null
Whether the station named has work, and the first stage: null
refuses OrderRefusal.NothingToDo, a refusal of the kind’s own
refuses with it. A pure read, on the authoritative step.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context |
OrderPlanContext |
Returns
Section titled “Returns”OrderStageOptions<NoInfer<Stage>> | NoInfer<Refusal> | null
work()
Section titled “work()”work(
context):void
Moves the order on, each step its worker holds it and its routine
runs, travel included: setOrderStage for the next stage and
endOrder once done.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context |
OrderWorkContext<NoInfer<Stage>> |
Returns
Section titled “Returns”void