model

package model

Members list

Packages

package model.data
package model.entities
package model.managers

Type members

Classlikes

case class SimulationState(customers: Seq[Customer], games: List[Game], spawner: Option[Spawner], walls: List[Wall], ticker: Ticker, frameRate: Double)

Represents the complete state of the casino simulation at a given point in time.

Represents the complete state of the casino simulation at a given point in time.

SimulationState encapsulates all entities and components that make up the simulation, including customers, games, spawners, walls, and timing information. It serves as the central data structure that is passed between simulation updates, maintaining immutability for predictable state transitions.

The state includes all dynamic entities (customers, games) as well as static environment elements (walls) that define the simulation's physical boundaries and collision detection.

Value parameters

customers

sequence of all customer entities currently in the simulation

games

list of all game entities available for interaction

spawner

optional spawner entity for creating new customers

ticker

timing coordinator for managing simulation updates and scheduling

walls

list of wall entities that define physical boundaries

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Factory and utility object for creating SimulationState instances.

Factory and utility object for creating SimulationState instances.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Ticker(currentTick: Double, targetFramerate: Double, slotInterval: Double, rouletteInterval: Double, blackjackInterval: Double, spawnInterval: Double)

Manages timing and scheduling for different simulation events and game types.

Manages timing and scheduling for different simulation events and game types.

The Ticker provides a centralized timing system that coordinates when different game types should process rounds and when customer spawning should occur. It converts time intervals specified in seconds to tick-based scheduling using the target framerate, ensuring consistent timing regardless of actual frame rates.

Each game type can have its own update frequency, allowing for realistic timing where slot machines might update more frequently than roulette games, which take longer to complete a round in real casinos.

Value parameters

blackjackInterval

time in seconds between blackjack rounds

currentTick

the current simulation tick counter

rouletteInterval

time in seconds between roulette rounds

slotInterval

time in seconds between slot machine rounds

spawnInterval

time in seconds between customer spawning events

targetFramerate

the desired frames per second for the simulation

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Ticker

Factory object for creating Ticker instances with various configurations.

Factory object for creating Ticker instances with various configurations.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Ticker.type

Extensions

Extensions

extension (state: SimulationState)

Creates a new SimulationState with an additional customer.

Creates a new SimulationState with an additional customer.

Value parameters

customer

the customer entity to add

Attributes

Returns

new SimulationState including the specified customer

Creates a new SimulationState with an additional game.

Creates a new SimulationState with an additional game.

Games are prepended to the list for efficient insertion.

Value parameters

game

the game entity to add

Attributes

Returns

new SimulationState including the specified game

Creates a new SimulationState with an additional wall.

Creates a new SimulationState with an additional wall.

Walls are prepended to the list for efficient insertion.

Value parameters

wall

the wall entity to add

Attributes

Returns

new SimulationState including the specified wall

Creates a new SimulationState with an updated spawner.

Creates a new SimulationState with an updated spawner.

Value parameters

spawner

the spawner entity to set

Attributes

Returns

new SimulationState with the specified spawner

def updateFrameRate(frameRate: Double): SimulationState

Creates a new SimulationState with an updated framerate.

Creates a new SimulationState with an updated framerate.

Ticker is updated according to framerate

Value parameters

frameRate

the new framerate

Attributes

Returns

new SimulationState with the new framerate