Skip to content

WantData beta ​

Interface of @v12-engine/engine/ai

ts
export interface WantData

Something a computer player wants built or trained, as plain data (a map's file, a rule's action, a seat's options): a type, how many, under what condition, where, how important. WantData is what a save keeps; Want is the same with the function forms

Members ​

by ​

ts
by?: string;

Who wants it, for the report: order, production, economy, a goal's or a rule's id

count ​

ts
count?: number;

How many of it to have, those on their way counted: 1 when left out

id ​

ts
id?: string;

Its name: what the memory, the report and drop know it by. Made up when left out

keep ​

ts
keep?: boolean;

Whether the want stands: kept once met, and short again when what it made is lost, so that it is built anew. Wants of a brain's or a seat's options stand; one added as the game goes is dropped once met, unless it says so

near ​

ts
near?: Vec2 | string;

Where: a point, or the name of an entity the map or rules named. Home when left out

placement ​

ts
placement?: PlacementName;

How its spot is chosen (PlacementName): what the type declares, the brain's table, or the role's default when left out

priority ​

ts
priority?: number;

Wants are taken most important first, and the most important one that cannot be paid for saves up: 0 when left out

rebuild ​

ts
rebuild?: boolean;

For a standing want: whether a building lost is built again (the plan's rebuild when left out)

siteTimeout ​

ts
siteTimeout?: number;

Seconds without a spot for it before a want that does not stand is given up: the plan's siteTimeout when left out

spare ​

ts
spare?: number;

Money to have left over after paying for it: a luxury that waits for gold to spare. 0 when left out

type ​

ts
type: string;

The unit type wanted: a building, or a unit (whose buildings the plan puts up; the production plan trains it)

when ​

ts
when?: AiConditionData;

Only while this holds (AiConditionData, as a rule's): a tower after the first attack, a second hall past five minutes

within ​

ts
within?: number;

How far from there at the most: 22 when left out