Skip to content

GameBuilder beta ​

Interface of @v12-engine/engine

ts
export interface GameBuilder

The game a mod is applied to, as it stands after the mods before it

Members ​

abilities ​

ts
abilities: Collection<AbilityDef>;

The abilities of the game so far

addSystem ​

ts
addSystem(system: SystemDef): void;

Adds a system of the mod's own, or one in place of the engine's of the same name

areas ​

ts
areas: Collection<AreaDef>;

The parts of the map the rules watch, by id

buffs ​

ts
buffs: Collection<BuffDef>;

The buffs of the game so far

cellLayers ​

ts
cellLayers: Collection<CellLayerDef>;

The layers of cells painted on its maps, by id (Rules.cellLayers): a mod's own grass, with foliagePack among its packs

commands ​

ts
commands: Collection<CommandDef>;

The commands a player can give, by type (CommandDef)

components ​

ts
components: Collection<Component<any>>;

The state of its own the game keeps, by id: a mod's own components are added here

current ​

ts
readonly current: Readonly<Rules>;

What the game is so far: to read, not to change. Changes go through the rest of the builder

effects ​

ts
effects: Collection<EffectType>;

Kinds of ability effects, by their type (defineEffect)

events ​

ts
events: Collection<EventKey<any>>;

The events of its own the game emits, by id

hooks ​

ts
hooks: Collection<HookDef>;

The game's hook handlers, by id. withoutHook takes out one of the engine's

items ​

ts
items: Collection<ItemDef>;

The items of the game so far

listeners ​

ts
listeners: Collection<ListenerDef>;

How the game reacts to events, by id

orders ​

ts
orders: Collection<OrderBehavior>;

How unit orders are carried out, by type

packs ​

ts
packs: Collection<GamePack>;

The parts of the rules the game opts into (Rules.packs), by id: packs.add(heroesPack())

races ​

ts
races: Collection<RaceDef>;

The sides players can play (Rules.races)

resources ​

ts
resources: Collection<ResourceDef>;

The resources players gather and spend (Rules.resources)

sequences ​

ts
sequences: Collection<SequenceDef>;

The game's scripts of steps, by id

set ​

ts
set<K extends Setting>(key: K, value: Rules[K]): void;

Changes one of the game's settings that are one thing, not a list

settings ​

ts
settings(changes: RuleSettingsInit): void;

Changes rules of the game (RuleSettings): any of them, a group in part ({ supply: { max: 200 } })

stats ​

ts
stats: Collection<StatDef>;

The stats a unit has, by id (StatDef)

tags ​

ts
tags: Collection<TagDef>;

The tags of items the game names (Rules.tags, TagDef): what a shop shows of a tag and filters by

timers ​

ts
timers: Collection<TimerDef>;

What the game can set to go off later, by id

units ​

ts
units: Collection<UnitTypeDef>;

The unit types of the game so far

upgrades ​

ts
upgrades: Collection<UpgradeDef>;

The upgrades of the game so far

withoutCommand ​

ts
withoutCommand(type: string): void;

Takes out a command of the engine's or a pack's, by its type (Rules.withoutCommands)

withoutHook ​

ts
withoutHook(id: string): void;

Takes out one of the engine's hook handlers by id, which hooks cannot reach

withoutOrder ​

ts
withoutOrder(type: string): void;

Takes out an order of the engine's or a pack's, by its type (Rules.withoutOrders)

withoutSystem ​

ts
withoutSystem(name: string): void;

Takes out a system: one of the engine's, or one the game gave as an object, by name