Defines a contract for entities that possess a betting strategy.
This trait facilitates the integration of dynamic betting behaviors into entities that manage their own bankroll and customer state. It ensures that such entities can place bets, update their strategy based on outcomes, and change strategies.
Type parameters
T
The concrete type of the entity that extends this trait. It must also have Bankroll, CustomerState, and be able to provide a new instance with a changed betting strategy.
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.
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.