PlayerState beta
Interface of @v12-engine/engine
export interface PlayerStateA player as the screen is told of them: name, team, colour, resources and their standing to the player it is for
Members
color
color: [number, number, number];The player's colour as RGB, each 0..1
creeps
creeps?: boolean;Whether they are the creeps: hostile to everyone, but no one's rival
defeated
defeated: boolean;Whether the player is out of the game
id
id: PlayerId;The player's id
name
name: string;The name shown for the player
neutral
neutral: boolean;Whether the player is a neutral one, owner of mines and the like
own
own?: {
resources: Record<ResourceId, number>;
supplyUsed: number;
supplyCap: number;
supplies?: Record<string, {
used: number;
cap: number;
}>;
upkeep: {
tier: number;
name: string;
income: number;
};
upgrades: Record<string, number>;
researching: string[];
tech: string[];
heroes: HeroSummary[];
objectives: ObjectiveState[];
timers?: ShownTimer[];
unlocks?: Record<string, Message | null>;
availability?: Record<string, boolean>;
};Only filled in for the player the snapshot is for
race
race?: string;The race they play (raceOf): left out in a game without races
relation
relation: 'self' | 'ally' | 'enemy' | 'neutral';What they are to the player the snapshot is for: by their teams, or as the rules set it (setRelation)
shared
shared?: {
control: boolean;
vision: boolean;
};What the player the snapshot is for shares with this ally (shareWith): their units' control, and their team's sight (always, for an ally of their team). Left out for who is not an ally
team
team: number;The player's team number; players on one team are allies