Skip to content

EnemyKnowledge beta ​

Class of @v12-engine/engine/ai

ts
export declare class EnemyKnowledge

What a computer player remembers of its enemies (knowledge.enemy): their structures and bases, their army as last seen, their workers and heroes, the types and tech seen. Creeps are no one's enemy here

Members ​

constructor ​

ts
constructor(knowledge: Knowledge);

Constructs a new instance of the EnemyKnowledge class

armySeen ​

ts
armySeen(withinSeconds?: number): ArmySighting[];

Their army as last seen, in groups, newest first; only those seen within so many seconds where given

bases ​

ts
bases(owner?: PlayerId): EnemyBase[];

Their bases: the structures remembered, gone ones too, clustered by owner around what takes deposits (a hall), or around any structure where none does. The first seen of each owner's first; gone where all of it is known gone

expansionsSeen ​

ts
expansionsSeen(): EnemyBase[];

Their bases beyond the first of each owner's, with a hall: where they expanded to, as far as seen

heroesSeen ​

ts
heroesSeen(): UnitSeen[];

Their heroes as last seen, newest first: type, level, where, and died when seen to die

mostSeen ​

ts
mostSeen(type: string): number;

The most of a type of theirs seen at once: 0 for one never seen

sawType ​

ts
sawType(type: string, count: number, tick?: number): void;

Takes in what a type seen was, where the game or an older save tells: as if seen, count at once, at a tick

structures ​

ts
structures(options?: {
        owner?: PlayerId;
        gone?: boolean;
    }): StructureSeen[];

Their structures remembered and not known gone (gone: true for those too), of one owner where given

techSeen ​

ts
techSeen(): string[];

What they have, as far as what was seen tells: the types seen; what those require, named as UnitTypeDef.requires names them; and the building that trains a type, where only one does (a gryphon means an aviary, and what an aviary requires). Sorted, for the same answer every time

typesSeen ​

ts
typesSeen(): Readonly<Record<string, TypeSeen>>;

The unit and structure types of theirs seen, with when and the most seen at once

workersSeen ​

ts
workersSeen(withinSeconds?: number): UnitSeen[];

Their workers as last seen, newest first; only those seen within so many seconds where given