Ejemplo n.º 1
0
    public CurrencyData GetPurchase(int amount)
    {
        CurrencyData purchase   = Value.Copy <CurrencyData>();
        int          difference = amount - purchase.Amount;

        purchase.ChangeBy(difference);
        return(purchase);
    }
Ejemplo n.º 2
0
 public void SetCurrency()
 {
     if (ValueCurrencyType == CurrencyType.DogFood)
     {
         currency = FoodDatabase.GetInstance.Get(valueCurrencySubtype).Copy();
         int difference = k.SINGLE_VALUE - currency.Amount;
         currency.ChangeBy(difference);
     }
     else
     {
         throw new System.NotImplementedException();
     }
 }
Ejemplo n.º 3
0
 public void ChangeCurrencyAmount(CurrencyData currency)
 {
     if (isDogFood(currency))
     {
         ChangeFood(currency.Amount, (currency as DogFoodData).FoodType);
     }
     else
     {
         CurrencyData existingCurrency = getCurrency(currency.Type);
         existingCurrency.ChangeBy(currency.Amount);
     }
     tryCallCurrencyChangeEvent(currency.Type);
 }