Customer
The Customer is an entity which moves around the casino and plays games.
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait HasBetStrategy[Customer]trait CustomerState[Customer]trait StatusProfiletrait BoredomFrustration[Customer]trait MovableWithPrevious[Customer]trait Positionedtrait Entityclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Checks if the customer is currently in the Playing state.
Checks if the customer is currently in the Playing state.
Attributes
- Returns
-
trueif the customer is playing a game,falseotherwise. - Definition Classes
Attributes
- Definition Classes
Returns a new instance of the entity with an updated bankroll value. This method must be implemented by concrete classes to ensure immutability.
Returns a new instance of the entity with an updated bankroll value. This method must be implemented by concrete classes to ensure immutability.
Value parameters
- newBankroll
-
The new bankroll value.
- update
-
A boolean flag, often used to differentiate initial setting from an update, though its specific use depends on the implementing class.
Attributes
- Returns
-
A new instance of the entity with the new bankroll.
Abstract method to be implemented by concrete entities. It provides a way to return a new instance of the entity with an updated betting strategy, typically implemented using case class's copy method.
Abstract method to be implemented by concrete entities. It provides a way to return a new instance of the entity with an updated betting strategy, typically implemented using case class's copy method.
Value parameters
- newStrat
-
The new BettingStrategy to be set.
Attributes
- Returns
-
A new instance of the entity with the new strategy.
Returns a new instance of the entity with an updated boredom level. This method must be implemented by concrete classes to ensure immutability.
Returns a new instance of the entity with an updated boredom level. This method must be implemented by concrete classes to ensure immutability.
Value parameters
- newBoredom
-
The new boredom level.
Attributes
- Returns
-
A new instance of the entity with the new boredom level.
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
CustStatefor the customer.
Attributes
- Returns
-
A new instance of the entity with the updated customer state.
Returns a new instance of the entity with an updated direction. This method ensures immutability.
Returns a new instance of the entity with an updated direction. This method ensures immutability.
Value parameters
- newDirection
-
The new direction vector for the entity.
Attributes
- Returns
-
A new instance of the entity with the updated direction.
Attributes
- Definition Classes
Returns a new instance of the entity with an updated frustration level. This method must be implemented by concrete classes to ensure immutability.
Returns a new instance of the entity with an updated frustration level. This method must be implemented by concrete classes to ensure immutability.
Value parameters
- newFrustration
-
The new frustration level.
Attributes
- Returns
-
A new instance of the entity with the new frustration level.
Returns a new instance of the entity with an updated position. This method ensures immutability.
Returns a new instance of the entity with an updated position. This method ensures immutability.
Value parameters
- newPosition
-
The new position for the entity.
Attributes
- Returns
-
A new instance of the entity with the updated position.
Inherited methods
Returns a new instance of the entity with its direction updated by adding a given vector to the current direction.
Returns a new instance of the entity with its direction updated by adding a given vector to the current direction.
Value parameters
- addingDirection
-
The vector to add to the current direction.
Attributes
- Returns
-
A new instance of the entity with the added direction.
- Inherited from:
- Movable
Calculates the ratio of the current bankroll to the starting bankroll. This is useful for tracking profit/loss relative to the initial investment.
Calculates the ratio of the current bankroll to the starting bankroll. This is useful for tracking profit/loss relative to the initial investment.
Attributes
- Returns
-
The bankroll ratio (current bankroll / starting bankroll).
- Inherited from:
- Bankroll
Changes the entity's current betting strategy to a new one.
Changes the entity's current betting strategy to a new one.
Value parameters
- newStrat
-
The new BettingStrategy to adopt.
Attributes
- Returns
-
A new instance of the entity with the changed betting strategy.
- Inherited from:
- HasBetStrategy
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
CustStateto apply.
Attributes
- Returns
-
A new instance of the entity with the updated customer state.
- Inherited from:
- CustomerState
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. - Inherited from:
- CustomerState
Delegates the bet placement to the current betting strategy. The current entity instance is passed as context to the strategy.
Delegates the bet placement to the current betting strategy. The current entity instance is passed as context to the strategy.
Attributes
- Returns
-
A Bet object representing the placed bet.
- Inherited from:
- HasBetStrategy
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
Updates the entity's betting strategy based on the outcome of a game round. The current strategy's updateAfter method is called, and the entity is returned with the updated strategy (maintaining immutability).
Updates the entity's betting strategy based on the outcome of a game round. The current strategy's updateAfter method is called, and the entity is returned with the updated strategy (maintaining immutability).
Value parameters
- result
-
The outcome of the game round (e.g., money won/lost, 0 for push).
Attributes
- Returns
-
A new instance of the entity with the updated betting strategy.
- Inherited from:
- HasBetStrategy
Updates the entity's bankroll by adding a netValue. The netValue can be positive (gain) or negative (loss). A requirement ensures the bankroll does not drop below zero.
Updates the entity's bankroll by adding a netValue. The netValue can be positive (gain) or negative (loss). A requirement ensures the bankroll does not drop below zero.
Value parameters
- netValue
-
The amount to add to the current bankroll.
Attributes
- Returns
-
A new instance of the entity with the updated bankroll.
- Throws
-
IllegalArgumentException
if the new bankroll would be negative.
- Inherited from:
- Bankroll
Updates the entity's boredom level by adding a boredomGain. The new boredom level is clamped between 0.0 and 100.0.
Updates the entity's boredom level by adding a boredomGain. The new boredom level is clamped between 0.0 and 100.0.
Value parameters
- boredomGain
-
The amount to add to the current boredom level. Can be positive or negative.
Attributes
- Returns
-
A new instance of the entity with the updated boredom level.
- Inherited from:
- BoredomFrustration
Updates the entity's frustration level by adding a frustrationGain. The new frustration level is clamped between 0.0 and 100.0.
Updates the entity's frustration level by adding a frustrationGain. The new frustration level is clamped between 0.0 and 100.0.
Value parameters
- frustrationGain
-
The amount to add to the current frustration level. Can be positive or negative.
Attributes
- Returns
-
A new instance of the entity with the updated frustration level.
- Inherited from:
- BoredomFrustration