Package bet

Class Bet

java.lang.Object
bet.Bet
Direct Known Subclasses:
BasketballBet, FootballBet

public abstract sealed class Bet extends Object permits BasketballBet, FootballBet
Represents a generic betting option for a sports game, with specific odds, choices, and a result that can be set once the game outcome is determined.

This abstract class serves as a base for different types of bets, such as BasketballBet and FootballBet, each having distinct choices and outcome possibilities based on the type of sport. It encapsulates common properties like the game description, odds, available choices, and the final result.

The available choices are represented as characters:

  • For football bets: '1' for a win by the home team, 'X' for a draw, and '2' for an away team win.
  • For basketball bets: '1' for a win by the first team and '2' for a win by the second team.