TickLogic

io.github.srs.model.logic.TickLogic
trait TickLogic[S <: BaseState] extends BaseTickLogic[S]

Logic for handling simulation time updates.

Type parameters

S

the type of the simulation state.

Attributes

Graph
Supertypes
trait BaseTickLogic[S]
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

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 cats.effect.IO effect that produces the updated simulation state with the new simulation speed.

Inherited and 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 cats.effect.IO effect that produces the updated simulation state with the new elapsed time.

Inherited from:
BaseTickLogic