five-on-it / apps/server/src/notoriety / NotorietyTracker
Class: NotorietyTracker
Defined in: apps/server/src/notoriety.ts:45
Tracks each player's most stars and longest stretch at ten in one room.
Constructors
Constructor
new NotorietyTracker(
report?,tickRate?):NotorietyTracker
Defined in: apps/server/src/notoriety.ts:54
report hears of every record that grew (an account's alone); tickRate turns ticks into seconds (the simulation's by default).
Parameters
report?
(record) => void
tickRate?
number = TICK_RATE
Returns
NotorietyTracker
Methods
best()
best(
client):NotorietyBest|undefined
Defined in: apps/server/src/notoriety.ts:90
A player's record so far (a stretch under way not counted until it ends).
Parameters
client
number
Returns
NotorietyBest | undefined
leave()
leave(
client,tick):void
Defined in: apps/server/src/notoriety.ts:82
A player left the room: a stretch at ten under way ends here, and they are forgotten.
Parameters
client
number
tick
number
Returns
void
observe()
observe(
client,who,stars,tick,busted?):void
Defined in: apps/server/src/notoriety.ts:63
A player's stars on a tick, and whether the police busted them on it (an arrest ends a stretch at ten even on the tick the stars still read ten).
Parameters
client
number
who
stars
number
tick
number
busted?
boolean = false
Returns
void