Skip to content

StatField beta ​

Interface of @v12-engine/engine

ts
export interface StatField

A part of the stats a pack adds (GamePack.stats): a hero's growth by its level, in the heroes pack. stamp is a number that changes whenever what it adds does, and is 0 when it adds nothing: the stats are added up again when it changes, however it changed (a game that sets a hero's level itself says nothing, and need not)

Members ​

add ​

ts
add(world: World, entity: Entity, sum: StatSum): void;

Adds this field's part to the entity's stat sum

id ​

ts
readonly id: string;

The stat field's id, unique among the stat fields of a game

stamp ​

ts
stamp(entity: Entity): number;

A number that changes whenever what this field adds to the entity's stats changes, and is 0 when it adds nothing