FlatBetting

model.entities.customers.FlatBetting
See theFlatBetting companion object
case class FlatBetting[A <: Bankroll[A] & CustomerState[A]](betAmount: Double, option: List[Int]) extends BettingStrategy[A]

Implements a Flat Betting strategy. The bet amount remains constant regardless of previous game outcomes.

Type parameters

A

The entity type using this strategy.

Value parameters

betAmount

The fixed amount to bet.

option

Game-specific options for the bet.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait BettingStrategy[A]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def betType: BetStratType

Returns the type of this betting strategy.

Returns the type of this betting strategy.

Attributes

Returns

The BetStratType for this strategy.

Definition Classes
override def placeBet(ctx: A): Bet

Generates a game-specific bet for Flat Betting. Checks requirements and creates the appropriate Bet type based on the game.

Generates a game-specific bet for Flat Betting. Checks requirements and creates the appropriate Bet type based on the game.

Value parameters

ctx

The customer entity's context.

Attributes

Returns

A Bet object.

Throws
MatchError

if the customer state is not Playing or game type is unknown.

Definition Classes
override def updateAfter(ctx: A, result: Double): FlatBetting[A]

For Flat Betting, the strategy's state does not change after a game round. Returns the current instance.

For Flat Betting, the strategy's state does not change after a game round. Returns the current instance.

Value parameters

ctx

The customer entity's context (unused in FlatBetting).

result

The outcome of the game round (unused in FlatBetting).

Attributes

Returns

This FlatBetting instance.

Definition Classes

Inherited methods

protected def checkRequirement(ctx: A): Unit

Checks preconditions before placing a bet. Throws a require error if the bet amount exceeds bankroll or if the customer is not in a Playing state.

Checks preconditions before placing a bet. Throws a require error if the bet amount exceeds bankroll or if the customer is not in a Playing state.

Value parameters

ctx

The customer entity's context.

Attributes

Inherited from:
BettingStrategy
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product