using System; namespace PokerTournamentManager.Framework { public struct TournamentType { #region Properties private readonly GameType _Game; public GameType Game { get { return _Game; } } #region Buy-In private readonly Money _BuyInAmount; public Money BuyInAmount { get { return _BuyInAmount; } } private ChipCount _BuyInChipsAmount; /// /// Gets or sets the amount of chips received for a BuyIn. /// /// The amount of chips received for a BuyIn. public ChipCount BuyInChipsAmount { get { return _BuyInChipsAmount; } set { _BuyInChipsAmount = value; } } #endregion #region Rebuy Properties private readonly Money _RebuyPurchaseAmount; /// /// Gets the amount of Money it costs to purchase a Rebuy /// /// The amount of Money it costs to purchase a Rebuy. public Money RebuyPurchaseAmount { get { return _RebuyPurchaseAmount; } } private ChipCount _RebuyChipsAmount; /// /// Gets or sets the amount of chips received for a rebuy. /// /// The amount of chips received for a rebuy. public ChipCount RebuyChipsAmount { get { return _RebuyChipsAmount; } set { _RebuyChipsAmount = value; } } #endregion #region Add-On Properties private readonly Money _AddOnPurchaseAmount; /// /// Gets the amount of Money it costs to purchase an Add-On /// /// The amount of Money it costs to purchase an Add-On. public Money AddOnPurchaseAmount { get { return _AddOnPurchaseAmount; } } private ChipCount _AddOnChipsAmount; /// /// Gets or sets the amount of chips received for an Add-On. /// /// The amount of chips received for an Add-On. public ChipCount AddOnChipsAmount { get { return _AddOnChipsAmount; } set { _AddOnChipsAmount = value; } } #endregion private readonly BuyInOptions _AvailableOptions; public BuyInOptions AvailableOptions { get { return _AvailableOptions; } } #endregion #region Constructors public TournamentType(GameType gameType, Money buyInAmount, ChipCount buyInChipsAmount) { this._Game = gameType; this._BuyInAmount = buyInAmount; this._BuyInChipsAmount = buyInChipsAmount; _AvailableOptions = BuyInOptions.Rebuy; _AddOnPurchaseAmount = null; _AddOnChipsAmount = new ChipCount(0); _RebuyPurchaseAmount = null; _RebuyChipsAmount = new ChipCount(0); } public TournamentType(GameType gameType, Money buyInAmount, ChipCount buyInChipsAmount, Money addonPurchaseAmount, ChipCount addonChipsAmount, Money rebuyPurchaseAmount, ChipCount rebuyChipsAmount) { this._Game = gameType; this._BuyInAmount = buyInAmount; this._BuyInChipsAmount = buyInChipsAmount; // Set the available options this._AvailableOptions = BuyInOptions.BuyIn; if (rebuyPurchaseAmount != null && rebuyPurchaseAmount.Amount > 0) this._AvailableOptions &= BuyInOptions.Rebuy; if (addonPurchaseAmount != null && addonPurchaseAmount.Amount > 0) this._AvailableOptions &= BuyInOptions.AddOn; _AddOnPurchaseAmount = addonPurchaseAmount; _AddOnChipsAmount = addonChipsAmount; _RebuyPurchaseAmount = rebuyPurchaseAmount; _RebuyChipsAmount = rebuyChipsAmount; } #endregion } }