public static Potion operator +(Potion x, int y) { Potion newPotion = new Potion(x.Value); newPotion.Value += y; if (newPotion.Value < 0) newPotion.Value = 0; return newPotion; }
public static Potion operator -(Potion x, Potion y) { Potion newPotion = new Potion(x.Value); newPotion.Value -= y.Value; if (newPotion.Value < 0) newPotion.Value = 0; return newPotion; }
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; } }
public Potion(Potion value) : base(value.Value) { }
internal void Add(Currency currency) { _Coin += currency.Coin; _Potion += currency.Potion; }
public Currency(Currencies.Coin coin, Currencies.Potion potion) { _Coin.Value = coin.Value; _Potion.Value = potion.Value; }