TickLogic

io.github.srs.model.logic.TickLogic
trait TickLogic[S <: State]

Logic for handling simulation time updates.

Type parameters

S

the type of the simulation state.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def tick(s: S, delta: FiniteDuration): IO[S]

Updates the simulation state by advancing the elapsed time by the given delta duration.

Updates the simulation state by advancing the elapsed time by the given delta duration.

Value parameters

delta

the duration to advance the elapsed time.

s

the current simulation state.

Attributes

Returns

an IO effect that produces the updated simulation state with the new elapsed time.

def tickSpeed(s: S, speed: SimulationSpeed): IO[S]

Updates the simulation state by changing the simulation speed.

Updates the simulation state by changing the simulation speed.

Value parameters

s

the current simulation state.

speed

the new simulation speed to set.

Attributes

Returns

an IO effect that produces the updated simulation state with the new simulation speed.