Available beta
Interface of @v12-engine/engine
ts
export interface AvailableWhether a player may make a unit type or research an upgrade at all, before what it requires (see isAvailable): by default (available), what is of no race or of theirs (race). Set it otherwise for a game's own way: what a mode takes away, a roster that grows as a campaign goes, a unit only one player may have. What is not available is not on the player's buttons, and an order for it is refused; their screen is told where this decided otherwise
Members
available
ts
available: boolean;Whether the player may make it at all; the engine sets it from the race, a handler may change it
id
ts
readonly id: string;The unit type or upgrade being asked about
kind
ts
readonly kind: 'unit' | 'upgrade';Whether it is for a unit type or an upgrade
player
ts
readonly player: PlayerId;The player who would make it
race
ts
readonly race: string | undefined;The race the player plays, if the game has races