ComputerPlayer beta
Interface of @v12-engine/engine/ai
export interface ComputerPlayerA computer player: whatever plays a seat of a world from what it sees, through commands as a player does. The engine's own is a Brain of modules (defineBrain), the melee player among them; a game gives its own in code (defineComputer, listed in Rules.brains). think is asked about once a second (createComputerSystem); save and restore keep what it remembers through a save
Members
busy
readonly busy?: boolean;Whether a think is under way across ticks (a brain's budget): it is asked to think on at the next tick
dispose
dispose?(): void;Lets go of what it holds outside its seat, once unseated
inspect
inspect?(): unknown;What it is thinking, as plain data: what the debug tools show of the player it plays (its goal, its scores)
paused
paused?: boolean;Whether it sits still (world.computers.pause). A player without the field cannot be paused
restore
restore?(memory: unknown): void;Takes back what save gave, from a saved game
save
save?(): unknown;Gives what it remembers as plain data for a save; when left out it remembers nothing
tell
tell?(word: string, data: unknown, tick: number): void;Takes in a word from the game (world.computers.tell), with the tick it is told at
think
think(): void;Runs one think: looks at the world and sends commands as a player does