model.entities.games
Members list
Type members
Classlikes
Base trait for all betting operations in casino games.
Base trait for all betting operations in casino games.
Defines the common interface that all bet types must implement, ensuring every bet has an associated monetary amount.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Represents a bet placed on a blackjack game with a minimum hand value strategy.
Represents a bet placed on a blackjack game with a minimum hand value strategy.
BlackJack bets include a minimum value parameter that likely represents the minimum hand value the player is aiming to achieve or stand on.
Value parameters
- amount
-
the monetary amount being wagered
- minimumValue
-
the minimum card value threshold for the betting strategy
Attributes
- Throws
-
IllegalArgumentException
if minimumValue is not positive
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Betclass Objecttrait Matchableclass AnyShow all
Implementation of a blackjack game.
Implementation of a blackjack game.
Blackjack supports up to 7 players and uses a minimum value strategy for decision making. Uses BlackJackStrategy for game logic.
Value parameters
- gameHistory
-
historical record of gains and losses
- gameState
-
current player state and capacity
- id
-
unique identifier for this blackjack game
- position
-
2D coordinates in the simulation space
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Gametrait CollidableEntitytrait Entitytrait Collidabletrait Positionedtrait Sizedclass Objecttrait Matchableclass AnyShow all
Factory object for creating blackjack strategy builders.
Factory object for creating blackjack strategy builders.
Provides a convenient entry point for constructing blackjack betting strategies using the builder pattern.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BlackJackStrategy.type
Builder for constructing blackjack betting strategies.
Builder for constructing blackjack betting strategies.
Uses the builder pattern to configure bet amounts, minimum hand values, and conditions before creating the final strategy instance.
Value parameters
- betAmount
-
optional bet amount (defaults to 0.5 if not specified)
- condition
-
optional execution condition function
- minimumVal
-
optional minimum hand value threshold (defaults to 17 if not specified)
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Executable blackjack strategy instance.
Executable blackjack strategy instance.
Implements simplified blackjack logic where both dealer and player draw cards until reaching their respective thresholds. Player wins if dealer busts (>21) or if player has higher value ≤21. Blackjack (21) pays 3x, other wins pay 2x.
Value parameters
- betAmount
-
the amount being wagered
- condition
-
function determining if the strategy should execute
- minimumValue
-
the minimum hand value the player will accept
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait GameStrategyclass Objecttrait Matchableclass AnyShow all
Represents a single monetary gain or loss record for a specific customer.
Represents a single monetary gain or loss record for a specific customer.
Encapsulates the result of a game round, tracking which customer participated and the monetary outcome. Positive values represent gains (winnings) while negative values represent losses.
Value parameters
- from
-
the unique identifier of the customer who played
- of
-
the monetary amount gained (positive) or lost (negative)
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Abstract base trait for all casino games in the simulation.
Abstract base trait for all casino games in the simulation.
Represents a game entity that can be positioned in 2D space, maintains player state, tracks game history, and supports collision detection. Games can be locked/unlocked by players and process bets according to their specific game rules.
Value parameters
- gameHistory
-
historical record of all gains and losses
- gameState
-
current state including players and capacity
- id
-
unique identifier for the game instance
- position
-
2D coordinates of the game in the simulation space
Attributes
- Supertypes
-
trait CollidableEntitytrait Entitytrait Collidabletrait Positionedtrait Sizedclass Objecttrait Matchableclass AnyShow all
- Known subtypes
Factory object for creating game instances with default configurations.
Factory object for creating game instances with default configurations.
Provides convenient methods to create games with auto-generated IDs and appropriate default settings for player capacity and initial state.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
GameBuilder.type
Maintains the complete history of all gains and losses for a game.
Maintains the complete history of all gains and losses for a game.
Tracks all monetary transactions that have occurred during the game's lifetime, providing methods to calculate overall performance and add new entries. The history is immutable - updates create new instances.
Value parameters
- gains
-
chronological list of all gain/loss records
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Resolves game interactions between customers and games in the simulation.
Resolves game interactions between customers and games in the simulation.
The GameResolver is responsible for processing all active games by identifying playing customers, executing their bets, and updating game histories with the results. It handles the coordination between customer actions and game state updates in each simulation tick.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
GameResolver.type
Represents the current state of player occupancy for a game.
Represents the current state of player occupancy for a game.
Tracks the number of players currently engaged with a game, enforces capacity limits, and maintains a list of player identifiers. This immutable data structure ensures thread-safe state management and provides methods for adding and removing players with proper validation.
Value parameters
- currentPlayers
-
the number of players currently in the game
- maxAllowedPlayers
-
the maximum capacity of players for this game
- playersId
-
the list of unique identifiers for all current players
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Base trait for all game strategy implementations.
Base trait for all game strategy implementations.
Defines the common interface that all game strategies must implement to execute betting logic and return results.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Marker trait representing different types of casino games.
Marker trait representing different types of casino games.
Used for type-safe identification and categorization of game implementations.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Represents a bet placed on a roulette game with specific number targets.
Represents a bet placed on a roulette game with specific number targets.
Roulette bets allow players to wager on one or more numbers on the wheel. All target numbers must be valid roulette numbers (0-36).
Value parameters
- amount
-
the monetary amount being wagered
- targets
-
the list of roulette numbers (0-36) being bet on
Attributes
- Throws
-
IllegalArgumentException
if any target is outside the valid range (0-36)
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Betclass Objecttrait Matchableclass AnyShow all
Implementation of a roulette game.
Implementation of a roulette game.
Roulette allows up to 6 players to bet on numbers 0-36. Uses RouletteStrategy for game logic and bet processing.
Value parameters
- gameHistory
-
historical record of gains and losses
- gameState
-
current player state and capacity
- id
-
unique identifier for this roulette game
- position
-
2D coordinates in the simulation space
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Gametrait CollidableEntitytrait Entitytrait Collidabletrait Positionedtrait Sizedclass Objecttrait Matchableclass AnyShow all
Factory object for creating roulette strategy builders.
Factory object for creating roulette strategy builders.
Provides a convenient entry point for constructing roulette betting strategies using the builder pattern.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
RouletteStrategy.type
Builder for constructing roulette betting strategies.
Builder for constructing roulette betting strategies.
Uses the builder pattern to configure bet amounts, target numbers, and conditions before creating the final strategy instance.
Value parameters
- betAmount
-
optional bet amount (defaults to 0.5 if not specified)
- targets
-
optional list of target numbers (defaults to List(0) if not specified)
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Executable roulette strategy instance.
Executable roulette strategy instance.
Implements roulette logic with a 37-number wheel (0-36). Winning pays based on the number of targets bet on: payout = betAmount * 37 / targets.size.
Value parameters
- betAmount
-
the amount being wagered
- condition
-
function determining if the strategy should execute
- targets
-
the list of numbers being bet on
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait GameStrategyclass Objecttrait Matchableclass AnyShow all
Represents a bet placed on a slot machine game.
Represents a bet placed on a slot machine game.
Slot bets are simple wagers with only an amount, as slot machines typically don't require additional betting parameters.
Value parameters
- amount
-
the monetary amount being wagered
Attributes
- Throws
-
IllegalArgumentException
if amount is not positive
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Betclass Objecttrait Matchableclass AnyShow all
Game type representing slot machine games
Implementation of a slot machine game.
Implementation of a slot machine game.
Slot machines are single-player games that accept simple monetary bets. Uses SlotStrategy for game logic and payout calculations.
Value parameters
- gameHistory
-
historical record of gains and losses
- gameState
-
current player state (max 1 player)
- id
-
unique identifier for this slot machine
- position
-
2D coordinates in the simulation space
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Gametrait CollidableEntitytrait Entitytrait Collidabletrait Positionedtrait Sizedclass Objecttrait Matchableclass AnyShow all
Executes the strategy and returns the betting result.
Executes the strategy and returns the betting result.
Attributes
- Returns
-
BetResult indicating win (Success) or loss (Failure) with monetary amounts
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SlotStrategy.type
Builder for constructing slot machine betting strategies.
Builder for constructing slot machine betting strategies.
Uses the builder pattern to configure bet amounts and conditions before creating the final strategy instance.
Value parameters
- betAmount
-
optional bet amount (defaults to 0.5 if not specified)
- condition
-
optional execution condition function
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Executable slot machine strategy instance.
Executable slot machine strategy instance.
Implements slot machine logic where winning requires all 5 generated numbers to be identical. Winning pays 10x the bet amount.
Value parameters
- betAmount
-
the amount being wagered
- condition
-
function determining if the strategy should execute
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait GameStrategyclass Objecttrait Matchableclass AnyShow all
Domain Specific Language (DSL) for game strategy creation.
Domain Specific Language (DSL) for game strategy creation.
Provides a fluent, readable interface for constructing game strategies using a natural language-like syntax. The DSL abstracts the direct factory method calls and enables more expressive code when building betting strategies.
Example usage:
val strategy = use(SlotStrategy).bet(10.0).when(true)
val rouletteStrategy = use(RouletteStrategy).bet(5.0).on(List(1, 2, 3)).when(true)
val blackjackStrategy = use(BlackJackStrategy).bet(20.0).accept(18).when(true)
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
dsl.type
Value members
Concrete fields
Game's types present in the current implementation
Game's types present in the current implementation