Builder

model.SimulationState.Builder
case class Builder(customers: Seq[Customer], games: List[Game], spawner: Option[Spawner], walls: List[Wall])

Builder class for constructing SimulationState instances using a fluent API.

Provides a convenient way to incrementally build complex simulation states by adding entities one at a time or in groups. The builder pattern ensures that all required components can be configured before creating the final immutable state.

Value parameters

customers

current collection of customer entities

games

current collection of game entities

spawner

optional spawner entity

walls

current collection of wall entities

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def addCustomer(customer: Customer): Builder

Adds a single customer to the existing collection.

Adds a single customer to the existing collection.

Value parameters

customer

the customer entity to add

Attributes

Returns

updated builder with the additional customer

def addGame(game: Game): Builder

Adds a single game to the existing collection.

Adds a single game to the existing collection.

Games are prepended to the list for efficient insertion.

Value parameters

game

the game entity to add

Attributes

Returns

updated builder with the additional game

def addWall(wall: Wall): Builder

Adds a single wall to the existing collection.

Adds a single wall to the existing collection.

Walls are prepended to the list for efficient insertion.

Value parameters

wall

the wall entity to add

Attributes

Returns

updated builder with the additional wall

Constructs the final SimulationState from the current builder configuration.

Constructs the final SimulationState from the current builder configuration.

Attributes

Returns

immutable SimulationState with default ticker settings

def withCustomers(customers: Seq[Customer]): Builder

Sets the complete collection of customers for the simulation.

Sets the complete collection of customers for the simulation.

Value parameters

customers

the customer entities to include

Attributes

Returns

updated builder with the specified customers

def withGames(games: List[Game]): Builder

Sets the complete collection of games for the simulation.

Sets the complete collection of games for the simulation.

Value parameters

games

the game entities to include

Attributes

Returns

updated builder with the specified games

def withSpawner(spawner: Spawner): Builder

Sets the spawner for the simulation.

Sets the spawner for the simulation.

Value parameters

spawner

the spawner entity to use for customer creation

Attributes

Returns

updated builder with the specified spawner

def withWalls(walls: List[Wall]): Builder

Sets the complete collection of walls for the simulation.

Sets the complete collection of walls for the simulation.

Value parameters

walls

the wall entities to include for boundary definition

Attributes

Returns

updated builder with the specified walls

Removes the spawner from the simulation configuration.

Removes the spawner from the simulation configuration.

Attributes

Returns

updated builder with no spawner

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product