Skip to content

ResourceInfo beta ​

Interface of @v12-engine/client

ts
export interface ResourceInfo

What the player has, as the top bar shows it

Members ​

allies ​

ts
allies?: {
        id: number;
        name: string;
        color: string;
        control: boolean;
        vision: boolean;
        team: boolean;
    }[];

The player's allies still in the game, to give resources to (see the engine's give) and share with (shareWith): whether the player shares control and sight with each, and whether they are of the player's team (who sees as one already). None for who only watches

amounts ​

ts
amounts: ResourceAmount[];

The game's resources, in its order

players ​

ts
players?: ObservedPlayer[];

For who only watches (GameSession.observer): every player's, a line each, in place of their own

supplies ​

ts
supplies: {
        id: string;
        name: string;
        used: number;
        cap: number;
    }[];

The game's other pools of supply (RuleSettings.supply.pools), in its order: what each is called, used and its cap. None in a game with none

supply ​

ts
supply: boolean;

Whether the game has supply (food) at all: some unit takes it up, or some building provides it

supplyCap ​

ts
supplyCap: number;

The most supply the player's buildings provide

supplyUsed ​

ts
supplyUsed: number;

Supply (food) in use: what the player's units and buildings in the making take up

upkeep ​

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

The upkeep tier the player is at: its number, its name, and the share of income kept (1 for none cut)

upkept ​

ts
upkept: string[];

Names of the resources upkeep cuts into. Empty for a game without upkeep, which shows none