using System; namespace PokerTournamentManager.Framework { public struct TournamentSettings { #region Properties #region Game Type private readonly GameType _Game; /// /// Gets the type of game to be played. /// /// The type of game to be played. public GameType Game { get { return _Game; } } #endregion #region Buy-In private readonly Money _BuyInAmount; public Money BuyInAmount { get { return _BuyInAmount; } } private ChipCount _StartingChipsAmount; /// /// Gets or sets the amount of chips received when a player Buys In. /// /// The amount of chips received when a player Buys In. public ChipCount StartingChipsAmount { get { return _StartingChipsAmount; } set { _StartingChipsAmount = 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 #region Available BuyIn Options private readonly BuyInOptions _AvailableOptions; public BuyInOptions AvailableOptions { get { return _AvailableOptions; } } #endregion #endregion #region Constructors public TournamentSettings(GameType gameType, Money buyInAmount, ChipCount buyInChipsAmount) { this._Game = gameType; this._BuyInAmount = buyInAmount; this._StartingChipsAmount = buyInChipsAmount; _AvailableOptions = BuyInOptions.Rebuy; _AddOnPurchaseAmount = null; _AddOnChipsAmount = new ChipCount(0); _RebuyPurchaseAmount = null; _RebuyChipsAmount = new ChipCount(0); } public TournamentSettings(GameType gameType, Money buyInAmount, ChipCount buyInChipsAmount, Money addonPurchaseAmount, ChipCount addonChipsAmount, Money rebuyPurchaseAmount, ChipCount rebuyChipsAmount) { this._Game = gameType; this._BuyInAmount = buyInAmount; this._StartingChipsAmount = 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 } }