Skip to content

Me beta ​

Interface of @v12-engine/engine/ai

ts
export interface Me

The player a brain plays, as its picture of the game shows them: what the snapshot has of one's own player (PlayerState.own), beside who they are. Mutable for the think: a module that sends a train bumps supplyUsed itself, so that the next module does not queue past the cap before the command lands

Members ​

availability ​

ts
availability?: Record<string, boolean>;

What the game's available hook decided, where it differs from what their race says (PlayerState.own.availability)

defeated ​

ts
defeated: boolean;

Whether the player is out of the game

heroes ​

ts
heroes: HeroSummary[];

The player's heroes, each in short

id ​

ts
id: PlayerId;

The player's id

income ​

ts
income?: Record<ResourceId, number>;

What the player gathers of each resource a minute, of late, as the brain's knowledge works it out (Knowledge.own.income): set by the brain after the view is made; left out for a view of no brain's

name ​

ts
name: string;

The player's name

objectives ​

ts
objectives: ObjectiveState[];

What the player is set to do, in a mission. Empty in a game without objectives

purse ​

ts
purse?: Readonly<Record<ResourceId, number>>;

What is free to spend this think, by resource: the resources less what is promised and held, less what the think spent so far (the brain's purse, ai.purse). Set by the brain after the view is made; left out for a view of no brain's

race ​

ts
race?: string;

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

researching ​

ts
researching: string[];

The ids of the upgrades being researched

resources ​

ts
resources: Record<ResourceId, number>;

What they have of each resource, by resource id

supplies ​

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

The game's other pools of supply, by name (RuleSettings.supply.pools)

supplyCap ​

ts
supplyCap: number;

How much supply the player may use at most

supplyUsed ​

ts
supplyUsed: number;

How much supply the player's units and queues use

team ​

ts
team: number;

The player's team number

tech ​

ts
tech: string[];

Types of the finished buildings the player has, with what those count as

unlocks ​

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

What the game's requirement hook decided, where it differs from what the requirements say (PlayerState.own.unlocks)

upgrades ​

ts
upgrades: Record<string, number>;

The levels of the upgrades the player has, by upgrade id

upkeep ​

ts
upkeep: {
        tier: number;
        name: string;
        income: number;
    };

What the size of the army costs in income