five-on-it / packages/sim/src/testing / eachWorld
Function: eachWorld()
eachWorld(
current):object
Defined in: packages/sim/src/testing.ts:57
Loads the physics before a file's tests and frees the world current() returns after each test; returns helpers that step that world.
Parameters
current
() => SimWorld
Returns
board
board: (
eid,ticks) =>boolean
Gets a character on foot in by the interaction key: one press, then steps while it goes to the door and gets in (at most ticks); returns whether it is seated.
Parameters
eid
number
ticks?
number = 240
Returns
boolean
press
press: (
eid) =>void
Presses the interaction key on a character for one step, then lets go of it.
Parameters
eid
number
Returns
void
run
run: (
eid,input,ticks) =>void
Holds an input (idle but for input) on an entity for ticks steps.
Parameters
eid
number
input
Partial<VehicleInputLike>
ticks
number
Returns
void
steps
steps: (
ticks) =>void
Steps the world ticks times.
Parameters
ticks
number
Returns
void
stepsWithPedestrians
stepsWithPedestrians: (
ticks) =>void
The same with the pedestrians deciding before every step, as the server runs them.
Parameters
ticks
number
Returns
void