Skip to content

ScoreStatDef beta ​

Interface of @v12-engine/engine

ts
export interface ScoreStatDef

A number the score keeps for each player (RuleSettings.score, defineStat): what it is called, how it adds up, where it comes from, and how it is shown. One with no source is counted by the game's code alone (world.score.add)

Members ​

byType ​

ts
byType?: boolean;

Kept by what it was counted of too (ScoreCount.type): units killed by unit type, abilities cast by ability

category ​

ts
category?: string;

The tab of the score screen it is in: units, heroes, resources, combat, or the game's own. other when left out

description ​

ts
description?: string;

What the screen says it is, in a tip

format ​

ts
format?: ScoreFormat;

How its number is written: number (when left out), decimal, percent (0 to 1), time (seconds)

from ​

ts
from?: ScoreSource | readonly ScoreSource[];

The events it is counted from

hidden ​

ts
hidden?: boolean;

Counted, and not on the score screen: for the game's own use (an achievement, a mission's goal)

id ​

ts
id: string;

Its own, among the game's stats: world.score.add(player, id, …) names it

kind ​

ts
kind?: ScoreKind;

How it adds up: sum when left out, last for one that only samples

label ​

ts
label?: string;

What it is called on a screen: its id when left out

sample ​

ts
sample?(world: World, player: PlayerId): number | undefined;

A gauge: what it is for a player now (their supply used, their gold), read once a second and at each point of the timeline, and taken as kind says (last when left out). Nothing taken for undefined

timeline ​

ts
timeline?: boolean;

On the timeline: sampled every ScoreSettings.every seconds, for a screen's graph