SidePaths beta
Class of @v12-engine/engine
export declare class SidePathsThe navigations of the sides, to plan routes on
Members
attach
attach(world: World): void;Listens to the world for what every side knows as it happens: the map's, and each side's own and its allies' buildings, put down and gone. Given what the world has now, in its order, first: what a load starts from
create
static create(terrain: Terrain, teams: readonly number[], options?: RecastNavigationOptions): Promise<SidePaths>;A navigation for each team, of the terrain alone, cut for options (the world's smallest unit)
dispose
dispose(): void;Frees what the object holds, such as its subscriptions and each side's navigation
forget
forget(team: number, id: number): void;A team knows a building is gone
groundChanged
groundChanged(cells: readonly number[], walkability?: boolean): void;A slowing layer of cells changed on these cells: each side's navigation weighs them again, as the world's does (EN2)
has
has(team: number): boolean;Whether a team plans with what it knows
known
known(team: number): ReadonlyMap<number, Rect>;The buildings a team knows, by id
knows
knows(team: number, id: number): boolean;Whether the team knows the building by its id
learn
learn(team: number, id: number, rect: Rect, seen?: boolean): void;A team knows a building from now: it is in the way of its routes. seen for one it learned of by sight
reshape
reshape(area?: CellArea): void;The ground was reshaped: each side's navigation cut again of it, as the world's is
restore
restore(world: World, saved: Record<number, KnownBuilding[]>): void;After a load: what every side knows of the world as it is (attach), then what each learned by sight
route
route(team: number, from: Vec2, to: Vec2): Vec2[] | null;The corners of a route from one point to another, as the team knows the ground. Null where it knows no way
save
save(): Record<number, KnownBuilding[]>;What the world keeps of it (sideKnowledge): what each side learned by sight
seen
seen(team: number): ReadonlyMap<number, Rect>;The buildings a team learned of by sight
settle
settle(): void;Brings each navigation up to date with what was learned and forgotten: before a route is planned on it
settleGround
settleGround(): void;What the ground's changes asked of each side's navigation done now, as the world's is as each tick ends
strangers
strangers(world: World, team: number): Generator<Entity>;Every enemy building of team's, in the order they were put there: the ones it can come to know by sight
version
version(team: number): number;One more each time what a team knows changes