示例#1
0
    public CurrencyData GetPurchase(int amount)
    {
        CurrencyData purchase   = Value.Copy <CurrencyData>();
        int          difference = amount - purchase.Amount;

        purchase.ChangeBy(difference);
        return(purchase);
    }
示例#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();
     }
 }
示例#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);
 }