Skip to content

BrainChecks beta ​

Class of @v12-engine/engine/ai

ts
export declare class BrainChecks implements BrainWatcher

Checks a brain against the invariants after each of its thinks, through what it is watched by (Brain.watch): what checkBrain makes, and keeps the broken rules in violations

Members ​

constructor ​

ts
constructor(
    brain: Brain, options?: AiCheckOptions);

Constructs a new instance of the BrainChecks class

brain ​

ts
readonly brain: Brain;

The brain the checks watch

sent ​

ts
sent(command: PlayerCommand): void;

Records a command the brain sent in this think, for the checks of commands and churn at the end of it

thought ​

ts
thought(): void;

Ends a think: runs the checks that are on over what was sent and returns nothing; found violations are kept

violations ​

ts
readonly violations: AiViolation[];

Every rule found broken, in the order found