예제 #1
0
		public static Coin operator -(Coin x, Coin y)
		{
			Coin newCoin = new Coin(x.Value);
			newCoin.Value -= y.Value;
			if (newCoin.Value < 0)
				newCoin.Value = 0;
			return newCoin;
		}
예제 #2
0
		public static Coin operator +(Coin x, int y)
		{
			Coin newCoin = new Coin(x.Value);
			newCoin.Value += y;
			if (newCoin.Value < 0)
				newCoin.Value = 0;
			return newCoin;
		}
예제 #3
0
		protected virtual void Dispose(bool disposing)
		{
			// Check to see if Dispose has already been called.
			if (!this.disposed)
			{
				// If disposing equals true, dispose all managed
				// and unmanaged resources.
				if (disposing)
				{
					// Dispose managed resources.
					_Coin = null;
					_Potion = null;
				}

				// Call the appropriate methods to clean up
				// unmanaged resources here.
				// If disposing is false,
				// only the following code is executed.

				// Note disposing has been done.
				disposed = true;
			}
		}
예제 #4
0
        protected virtual void Dispose(bool disposing)
        {
            // Check to see if Dispose has already been called.
            if (!this.disposed)
            {
                // If disposing equals true, dispose all managed
                // and unmanaged resources.
                if (disposing)
                {
                    // Dispose managed resources.
                    _Coin   = null;
                    _Potion = null;
                }

                // Call the appropriate methods to clean up
                // unmanaged resources here.
                // If disposing is false,
                // only the following code is executed.

                // Note disposing has been done.
                disposed = true;
            }
        }
예제 #5
0
		internal void Add(Currency currency)
		{
			_Coin += currency.Coin;
			_Potion += currency.Potion;
		}
예제 #6
0
		public override void Play(Player player)
		{
			base.Play(player);

			Choice choiceTrash = new Choice("Choose any number of cards to trash", this, player.Hand, player, false, 0, player.Hand.Count);
			ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
			player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));

			Coin totalCoinCost = new Coin();
			foreach (Card card in resultTrash.Cards)
				totalCoinCost += player._Game.ComputeCost(card).Coin;

			SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost == new Cost(totalCoinCost));
			Choice choice = new Choice("Gain a card", this, gainableSupplies, player, false);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Supply != null)
				player.Gain(result.Supply);
		}
예제 #7
0
 public Currency(Currencies.Coin coin, Currencies.Potion potion)
 {
     _Coin.Value   = coin.Value;
     _Potion.Value = potion.Value;
 }
예제 #8
0
 internal void Add(Currency currency)
 {
     _Coin   += currency.Coin;
     _Potion += currency.Potion;
 }
예제 #9
0
		public Coin(Coin value)
			: base(value.Value)
		{ }