model.entities.customers.CustomerState
Defines the contract for an entity that possesses a customer state.
This trait tracks whether a customer is Playing a game or Idle, providing methods to change this state and query their current activity.
Type parameters
-
T
-
The concrete type of the entity that extends this trait, enabling F-bounded polymorphism for immutable updates.
Attributes
-
Graph
-
-
Supertypes
-
class Object
trait Matchable
class Any
-
Known subtypes
-
Members list
Returns a new instance of the entity with the updated customer state. This method must be implemented by concrete classes to ensure immutability.
Returns a new instance of the entity with the updated customer state. This method must be implemented by concrete classes to ensure immutability.
Value parameters
-
newState
-
The new CustState for the customer.
Attributes
-
Returns
-
A new instance of the entity with the updated customer state.
Changes the customer's state to a new specified state. This is a convenience method that delegates to withCustomerState.
Changes the customer's state to a new specified state. This is a convenience method that delegates to withCustomerState.
Value parameters
-
newState
-
The new CustState to apply.
Attributes
-
Returns
-
A new instance of the entity with the updated customer state.
Returns an Option containing the Game object if the customer is currently Playing, otherwise returns Option.empty.
Returns an Option containing the Game object if the customer is currently Playing, otherwise returns Option.empty.
Attributes
-
Returns
-
An Option[Game] representing the game the customer is playing, if any.
Checks if the customer is currently in the Playing state.
Checks if the customer is currently in the Playing state.
Attributes
-
Returns
-
true if the customer is playing a game, false otherwise.
The current state of the customer (Playing or Idle).
The current state of the customer (Playing or Idle).
Attributes