ThreatMap beta
Class of @v12-engine/engine/ai
export declare class ThreatMapWhere the strength is, on a coarse grid over the map (AiView.threat, Brain.threat): at(point) reads a place, around(point, radius) the worst cell near it, hot() the cells where the enemy is strongest near what is one's own, cells() every cell with something in it (for a drawing of it). Made from the view's picture when first asked, once a think; all zeros for no point, or one off the map, so that a question about "the first base known" needs no guard
Members
constructor
constructor(
view: AiView);Constructs a new instance of the ThreatMap class
around
around(point: Vec2 | undefined, radius: number, query?: ThreatQuery): Threat;The worst cell within a distance of a point: the one the most enemy strength reaches. Zeros off the map
at
at(point: Vec2 | undefined, query?: ThreatQuery): Threat;What reaches a place: the friendly and the enemy strength at its cell, on a layer (ground when left out). All zeros for no point or one off the map
built
get built(): boolean;Whether a reading has been made this think: for the timing and the debug tools
cell
readonly cell = 8;The side of a cell in cells of the map
cells
cells(query?: ThreatQuery): ThreatCell[];Every cell that any strength reaches on a layer, in the grid's order: for a drawing of the map
cols
readonly cols: number;Cells across and down, and the side of one
hot
hot(query?: ThreatQuery & {
owner?: number;
}): ThreatCell[];Where the enemy is strongest near what is one's own: the cells that enemy strength reaches and that hold a unit or building of the player's (an ally's with owner), the hottest first. A raid at an expansion reads here while the main is quiet
rows
readonly rows: number;How many cells down the grid has
view
readonly view: AiView;The picture it is made from