Skip to content

MapKnowledge beta ​

Class of @v12-engine/engine/ai

ts
export declare class MapKnowledge

What a computer player remembers of the map (knowledge.map): when each place was last in sight. The cells are of the view's grid (8 units)

Members ​

constructor ​

ts
constructor(knowledge: Knowledge);

Constructs a new instance of the MapKnowledge class

camps ​

ts
camps(): readonly CampInfo[];

The map's creep camps, as the seat knows them (view.camps)

explored ​

ts
explored(point: Vec2): boolean;

Whether the seat's team has explored a place: seen it once, as the fog says

inSight ​

ts
inSight(point: Vec2): boolean;

Whether a place is in sight now, as of the last update

lastLooked ​

ts
lastLooked(point: Vec2): number | undefined;

The tick a place was last in sight of the seat's team: none for a place never seen

look ​

ts
look(point: Vec2, tick?: number): void;

Takes in that a place was looked at, at a tick: where the game or an older save tells

mines ​

ts
mines(): (MineInfo & {
        looked?: number;
        taken?: PlayerId;
    })[];

The map's mines (view.mines), each with when its place was last looked at and whose base is by it, as far as known: where to expand, where to look for theirs

sinceLooked ​

ts
sinceLooked(point: Vec2): number;

Seconds since a place was last in sight: Infinity for one never seen