MeleeArmy beta
Class of @v12-engine/engine/ai
export declare class MeleeArmyThe melee player's army: its waves of its own and the goals beside them (the file's comment), its numbers from its options (firstAttack, attackEvery, waveSize) and the defence's radius, its memory. Made for a brain by the army() module; reached as ai.module(MELEE_ARMY)?.army (meleeArmyOf(ai))
Members
constructor
constructor(
ai: Brain,
options: MeleeArmyOptions);Constructs a new instance of the MeleeArmy class
ai
readonly ai: Brain;The brain it is the army of
attackEvery
readonly attackEvery: number;Seconds between one wave's time and the next
defendRadius
readonly defendRadius: number;How far from a base, in cells, the army defends
firstAttack
readonly firstAttack: number;Seconds into the game the first wave is due
goals
goals(): GoalDef[];The goals, for the picker: attack, creep, raid, harass, expand (each unless left out)
inspect
inspect(): Record<string, unknown>;What it is thinking, for the debug tools: how hard it plays, its next wave, its roles
memory
readonly memory: MeleeArmyMemory;What the army remembers between thinks: wave size, next times and counts
options
readonly options: MeleeArmyOptions;How it goes: the module's options, the brain's settings over them (ai.settings.army)
ready
ready(): UnitSet;The fighters no goal holds and with nothing to do: what a wave or a party is made of. Once a think
restore
restore(data: unknown): void;Takes back what save gave
save
save(): MeleeArmyMemory;What it remembers, for a save: a copy
think
think(): void;Once a think, before the picker: whether the wave began waiting past its time, short of its size or outmatched