Skip to content

GoalClaims beta ​

Interface of @v12-engine/engine/ai

ts
export interface GoalClaims

What a goal claims to run: units from the pool and money from the purse. The picker gives each goal what it asks of what is left, best goal first

Members ​

money ​

ts
money?: number | Cost | ((ai: Brain) => number | Cost | undefined);

The money it holds while it runs, in the game's money (Registry.currency) as a number, or as a cost by resource; a function for one that depends. Held against the purse (Goals.reserved), given back when the goal stops

units ​

ts
units?: (ai: Brain, available: UnitSet) => Iterable<EntityState>;

The units it takes, chosen from what it may have (available: the pool, and what goals it may take from hold): the nearest six fighters, one scout, everything. A goal that asks for units and gets none is not picked