Skip to content

Plans beta ​

Class of @v12-engine/engine/ai

ts
export declare class Plans implements AiArea

A brain's plans (ai.plans): build for what is to be built, production for what is to be trained and researched, the game's build order over both. want is the one door: a want of a building goes to the build plan; one of a unit goes to the build plan for its buildings, and the production plan trains it

Members ​

constructor ​

ts
constructor(
    ai: Brain, options?: PlansOptions);

Constructs a new instance of the Plans class

afresh ​

ts
readonly afresh = "the save remembers what the computer player planned in a shape this brain does not read: it plans afresh";

What the log says where a save's memory of it is of a shape it does not read

ai ​

ts
readonly ai: Brain;

The brain they plan for

build ​

ts
readonly build: BuildPlan;

What to build, and the steps to it

drop ​

ts
drop(id: string): boolean;

Takes a want out, by id

follow ​

ts
follow(): PlansReport['order'] | undefined;

Works on the game's build order, once a think: the first item not had (what stands, is on its way or is queued counted; counts of a type adding up along the order) is a want before all others (order, priority 1000), and following is true. Called by the build plan as it thinks; a module may call it sooner

following ​

ts
get following(): boolean;

Whether the game's build order is still being followed: what the computer would make of itself waits

id ​

ts
readonly id = "plans";

Its id among the brain's areas: what its memory and its report are kept under

production ​

ts
readonly production: ProductionPlan;

What to train and research

remembers ​

ts
remembers(): boolean;

Whether it has anything to remember now: one that does not is left out of a save

report ​

ts
report(): PlansReport;

The purse and each plan's part, for the report

restore ​

ts
restore(memory: unknown): boolean;

Takes back what save gave: whether it was read

save ​

ts
save(): PlansMemory;

Gives a copy of the plans' memory, for a save of the brain

want ​

ts
want(def: Want): string;

Adds a want: what the brain works towards from now (BuildPlan.want). Gives back its id