Skip to content

OwnKnowledge beta ​

Class of @v12-engine/engine/ai

ts
export declare class OwnKnowledge

What a computer player remembers of itself (knowledge.own): what it lost, the attacks it sent, what it gathered

Members ​

constructor ​

ts
constructor(knowledge: Knowledge);

Constructs a new instance of the OwnKnowledge class

attacks ​

ts
attacks(withinSeconds?: number): AttackSent[];

The attacks sent, oldest first; only within so many seconds where given

attackSent ​

ts
attackSent(point: Vec2, count: number): void;

Notes an attack sent, for whoever asks later (attacks): what a module that sends an army calls

gathered ​

ts
get gathered(): Readonly<Record<ResourceId, number>>;

What was gathered of each resource since the game began, as far as the rises tell

history ​

ts
get history(): KnowledgeMemory['history'];

The samples of what was gathered, oldest first

income ​

ts
income(kind: ResourceId, seconds?: number): number;

What it gathers of a resource a minute, over the last so many seconds (60): from the rises in what it has, so it is at least this (what was gathered and spent between two thinks does not show). Bounty counts as gathered

incomes ​

ts
incomes(seconds?: number): Record<ResourceId, number>;

The income of every resource gathered so far, a minute (income)

lost ​

ts
lost(withinSeconds?: number): Loss[];

What of its own died, oldest first; only within so many seconds where given

lostNear ​

ts
lostNear(point: Vec2, radius: number, withinSeconds?: number): Loss[];

What of its own died within a distance of a place: "we are being raided here"