Skip to content

LanesPlay beta ​

Class of @v12-engine/engine/ai

ts
export declare class LanesPlay

The lanes of a lanes brain, read as its side sees them, and what its heroes do on them (ai.module('lanes')'s play): the module's goals read it

Members ​

constructor ​

ts
constructor(
    ai: Brain, 
    options: LanesPlayOptions);

Constructs a new instance of the LanesPlay class

ai ​

ts
readonly ai: Brain;

The brain it plays for

allyAt ​

ts
allyAt(at: Vec2): EntityState | undefined;

The ally's hero nearest a place: what a hero helping goes with

call ​

ts
call(from: Vec2): Vec2 | undefined;

An ally's hero in a fight one of its heroes could go to: the most hurt, near enough; or a person's call for help

camp ​

ts
camp(hero: EntityState): Vec2 | undefined;

The nearest camp it may take from a place: not cleared, in reach, its creeps (as seen) beatable

commanded ​

ts
commanded(units?: UnitSet): UnitSet;

The units it commands: its heroes, or what units says. Alive

fallBack ​

ts
fallBack(path: string, from: Vec2): Vec2 | undefined;

Where a hero outmatched on a lane falls back to: its side's nearest tower behind it, or so far back along it

home ​

ts
home(): Vec2 | undefined;

Where its heroes rest: home, else its side's building nearest the middle of its side's ends of the lanes (a core), else that middle, else its first building

lane ​

ts
lane(path: string): LaneSide | undefined;

A lane of its side's, by its path's name

lanes ​

ts
lanes(): readonly LaneSide[];

The lanes as its side reads them: each measured from the end its side's spawner stands at. None it has no end of

memory ​

ts
readonly memory: LanesPlayMemory;

What the play keeps between thinks, as LanesPlayMemory: the heroes resting and when each was sent home

oddsAt ​

ts
oddsAt(at: Vec2, reach?: number): number;

The odds of its side against theirs where a unit stands (Strength.odds): their towers that reach there count

options ​

ts
readonly options: LanesPlayOptions;

How it plays: the module's, the seat's over it

resting ​

ts
resting(): readonly EntityState[];

The heroes resting, alive

sendHome ​

ts
sendHome(hero: EntityState): void;

Sends a resting hero home: by an ability that takes it there (one whose effects, at its end, teleport home), where it has one ready and nothing hostile is near; else on foot. Nothing while it channels, or once home

spot ​

ts
spot(path: string): Vec2 | undefined;

Where a hero walks on a lane now: a little behind its side's front; with no wave there, by its side's furthest tower on it (or a little out of its end); never into reach of a tower of theirs that no minion of its side is in reach of

stake ​

ts
stake(path: string): number;

What is at stake on a lane, 0..1: how far along its side's wave is (a tower of theirs to take, their core), or how near its side's end theirs is (its own towers under attack), whichever is more

state ​

ts
state(path: string): LaneState | undefined;

One lane as it stands this think

states ​

ts
states(): readonly LaneState[];

Each lane as it stands this think: fronts, minions, heroes, towers. Once a think

think ​

ts
think(): void;

Heroes turned for home, those back out: what the lanes.back goal reads. Each think, before the goals