five-on-it / packages/protocol/src/police / parsePolice
Function: parsePolice()
parsePolice(
text): {camera:boolean;drone:boolean;k9?:"scent"|"lost";lasers:object[];light:boolean;marks:object[];radio:object[];scanner:boolean;talk?: {car:boolean;seconds:number;state:"ringing"|"talking";time:boolean; };tracked:boolean;type:"police"; } |undefined
Defined in: packages/protocol/src/police.ts:178
Parses a text frame as a player's police tells; undefined when it is not one.
Parameters
text
string
Returns
Type Literal
{ camera: boolean; drone: boolean; k9?: "scent" | "lost"; lasers: object[]; light: boolean; marks: object[]; radio: object[]; scanner: boolean; talk?: { car: boolean; seconds: number; state: "ringing" | "talking"; time: boolean; }; tracked: boolean; type: "police"; }
camera
camera:
boolean
A security or traffic camera has the player in sight now.
drone
drone:
boolean
The police drone has the player in sight now.
k9?
optionalk9?:"scent"|"lost"
A police dog after the player: on their scent, or off it (the trail broken in water).
lasers
lasers:
object[]
The marksmen's lasers painting the player now.
light
light:
boolean
The helicopter's searchlight has the player now.
marks
marks:
object[]
What the minimap marks.
radio
radio:
object[]
The radio's last lines the player hears, oldest first.
scanner
scanner:
boolean
The player carries the police scanner (PoliceScan Pro™).
talk?
optionaltalk?:object
The negotiator's call (six stars, a captive held): ringing (seconds it rings on), the talk open (its choices still on offer: more time, once; a car, once) and the team holding (seconds of holding left).
talk.car
car:
boolean
talk.seconds
seconds:
number
talk.state
state:
"ringing"|"talking"
talk.time
time:
boolean
tracked
tracked:
boolean
The car the player sits in carries a GPS tag.
type
type:
"police"
undefined