View

io.github.srs.view.ViewModule.View
trait View[S <: State]

View trait that defines the interface for the view.

Type parameters

S

the type of the state, which must extend ModelModule.State.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def close(): IO[Unit]

Closes the view and releases any resources.

Closes the view and releases any resources.

Attributes

Returns

an IO task that completes when the view is closed.

def init(queue: Queue[IO, Event]): IO[Unit]

Initializes the view with a queue for handling events.

Initializes the view with a queue for handling events.

Value parameters

queue

the queue that will be used to handle events in the view.

Attributes

Returns

an IO task that completes when the initialization is done.

def render(state: S): IO[Unit]

Renders the view based on the current state.

Renders the view based on the current state.

Value parameters

state

the current state of the simulation, which must extend ModelModule.State.

Attributes

Returns

the rendering task, which is an IO that completes when the rendering is done.

def timeElapsed(state: S): IO[Unit]

Handles the event when a certain amount of time has elapsed in the simulation.

Handles the event when a certain amount of time has elapsed in the simulation.

Value parameters

state

the resulting state after time has elapsed.

Attributes

Returns

an IO task that completes when the time elapsed event is handled.