Skip to content

SidePaths beta ​

Class of @v12-engine/engine

ts
export declare class SidePaths

The navigations of the sides, to plan routes on

Members ​

attach ​

ts
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 ​

ts
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 ​

ts
dispose(): void;

Frees what the object holds, such as its subscriptions and each side's navigation

forget ​

ts
forget(team: number, id: number): void;

A team knows a building is gone

groundChanged ​

ts
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 ​

ts
has(team: number): boolean;

Whether a team plans with what it knows

known ​

ts
known(team: number): ReadonlyMap<number, Rect>;

The buildings a team knows, by id

knows ​

ts
knows(team: number, id: number): boolean;

Whether the team knows the building by its id

learn ​

ts
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 ​

ts
reshape(area?: CellArea): void;

The ground was reshaped: each side's navigation cut again of it, as the world's is

restore ​

ts
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 ​

ts
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 ​

ts
save(): Record<number, KnownBuilding[]>;

What the world keeps of it (sideKnowledge): what each side learned by sight

seen ​

ts
seen(team: number): ReadonlyMap<number, Rect>;

The buildings a team learned of by sight

settle ​

ts
settle(): void;

Brings each navigation up to date with what was learned and forgotten: before a route is planned on it

settleGround ​

ts
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 ​

ts
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 ​

ts
version(team: number): number;

One more each time what a team knows changes