Skip to content

Message beta ​

Interface of @v12-engine/engine

ts
export interface Message

What the simulation tells a player, like "Not enough gold", is a key and some params, never words. The words are the business of the player's screen: the client has English for the engine's keys, and a game's view gives its own (GameView.hud.messages) or other words for the engine's. That keeps the engine free of any one language, and lets a game say "build more farms" where the engine only knows about supply.

Params that name something are ids (a resource, a unit type, an upgrade), for the screen to find the name of.

Members ​

key ​

ts
key: string;

The message's key, which the player's screen has words for (EngineMessages for the engine's, a game's own otherwise)

params ​

ts
params?: MessageParams;

What the words name or count, by param name; ids for what is a resource, a unit type or an upgrade