Skip to content

MapWorldOptions beta ​

Interface of @v12-engine/engine

ts
export interface MapWorldOptions extends WorldChecks

What a world made from a map is made from: the map, the rules, and what the lobby chose for the players

Members ​

colors ​

ts
colors?: Readonly<Record<PlayerId, [number, number, number]>>;

The colour of each player, by player, over the map's (MapPlayer.color): chosen in a lobby

components ​

ts
components?: readonly Component<unknown, unknown>[];

Components the app keeps in the world beside the game's own, as CreateWorldOptions.components

creeps ​

ts
creeps?: boolean;

Whether the world has the creeps player. When the map has something for it when left out: a camp, or something placed for the creeps. A world without camps that had one anyway would never be won: a team would always be left

log ​

ts
log?: Logger;

The logger the world's own is made under, as CreateWorldOptions.log

map ​

ts
map: GameMap;

The map the world is made from: its terrain, players and what it places

ts
navigation?: GameNavigationOptions;

Options for how the world's units find their way, over the game's (Rules.navigation)

onError ​

ts
onError?: ErrorPolicy;

What becomes of a part of the game that throws, as CreateWorldOptions.onError

races ​

ts
races?: Readonly<Record<PlayerId, string>>;

The race each player plays, by player (Rules.races): one of the game's, or random. Chosen in a lobby, a page's own menu. Those left out play what the map fixes for them (MapPlayer.race), or the game's first

rules ​

ts
rules: Rules;

The game's rules the world runs

seed ​

ts
seed?: number;

Seed of the world's random numbers: the same seed gives the same game

teams ​

ts
teams?: Readonly<Record<PlayerId, number>>;

The team each player plays for, by player, over the map's (MapPlayer.team): chosen in a lobby