Skip to content

five-on-it / packages/ai/src/police-swat / swatSystem

Function: swatSystem() ​

swatSystem(ai, players, order, room, spotFor, onDeploy): void

Defined in: packages/ai/src/police-swat.ts:473

One tick of SWAT (see the module documentation): the teams no longer whole are pruned (a van whose people are all gone is taken away), each team does its phase's work, and a van is sent after each player (most wanted first) whose stars ask for more, when it is time and the room has the actors for it (room), from the spot the dispatch picks (spotFor). onDeploy is told of each team whose doors open (the K9 unit comes with it).

Parameters ​

ai ​

AiWorld

players ​

ReadonlyMap<number, number>

order ​

readonly Wanted[]

room ​

() => number

spotFor ​

(w, eid) => { x: number; y: number; yaw: number; z: number; } | undefined

onDeploy ​

(team) => void

Returns ​

void