Skip to content

PlayerFacts beta ​

Interface of @v12-engine/engine

ts
export interface PlayerFacts

What there is to know about a player, for whether they can make something

Members ​

availability ​

ts
availability?: Record<string, boolean>;

What the simulation's available hook decided, where it differs from what their race says (availableTo): by unit or structure type, and upgrade:<id>

heroes ​

ts
heroes: readonly string[];

Types of the heroes they have, fallen ones and ones being made included

race ​

ts
race?: string;

The race they play (raceOf): left out in a game without races

resources ​

ts
resources: Readonly<Purse>;

What the player has of each resource, to meet a cost

supplies ​

ts
supplies?: Readonly<Record<string, {
        used: number;
        cap: number;
    }>>;

The game's other pools of supply, by name (RuleSettings.supply.pools): left out in a game with none

supplyCap ​

ts
supplyCap: number;

The most supply the player may use

supplyUsed ​

ts
supplyUsed: number;

Supply the player's units and queued units take up now

tech ​

ts
tech: ReadonlySet<string> | readonly string[];

Unit types they have, finished, which is what requirements ask for

unlocks ​

ts
unlocks?: Record<string, Message | null>;

What the simulation's requirement hook decided, where it differs from what the requirements say: by unit or structure type, and upgrade:<id> for the next level of research. A reason, or null for "may, for all that"