Skip to content

five-on-it / apps/client/src/renderer/car-doors / CarDoors

Class: CarDoors ​

Defined in: apps/client/src/renderer/car-doors.ts:45

The doors of the cars in the snapshots.

Constructors ​

Constructor ​

new CarDoors(doorwayOf, doorwayNear?): CarDoors

Defined in: apps/client/src/renderer/car-doors.ts:66

doorwayOf names the doorway of a seat of a car of a class (empty for none: an open seat); doorwayNear, the doorway nearest a point beside a car of a class, in its frame (to its left, ahead of its centre), when the client knows the doorways' places.

Parameters ​

doorwayOf ​

(cls, seat) => string

doorwayNear? ​

(cls, across, along) => string

Returns ​

CarDoors

Properties ​

opened ​

opened: number = 0

Defined in: apps/client/src/renderer/car-doors.ts:59

Doors opened so far, for the tests.

Methods ​

ajar() ​

ajar(eid): ReadonlyMap<string, number> | undefined

Defined in: apps/client/src/renderer/car-doors.ts:199

The doorways of the car eid ajar now, and how far (eased); undefined when every one is shut.

Parameters ​

eid ​

number

Returns ​

ReadonlyMap<string, number> | undefined


list() ​

list(): object[]

Defined in: apps/client/src/renderer/car-doors.ts:205

Every doorway ajar now, for the tests: the car, the doorway, how far.

Returns ​

object[]


observe() ​

observe(entities, events, now): void

Defined in: apps/client/src/renderer/car-doors.ts:102

Reads a snapshot taken at now (s): every seat taken or left since the last one opens its doorway, a carjack holds the driver's open through its beat.

Parameters ​

entities ​

readonly EntitySnapshot[]

events ​

readonly GameEvent[]

now ​

number

Returns ​

void


update() ​

update(now, dt): void

Defined in: apps/client/src/renderer/car-doors.ts:173

Moves every door on by dt seconds at now (s): toward open while held, else toward shut.

Parameters ​

now ​

number

dt ​

number

Returns ​

void