Exemplo n.º 1
0
 /// <summary>
 /// Overrides equals method
 /// </summary>
 public override bool Equals(AbstractCurrency other)
 {
     if (this._name.Equals(other.Name) && other.GetType() == this.GetType())
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Exemplo n.º 2
0
 public void AddCurrency(AbstractCurrency currency)
 {
     currencies.Add(currency);
     if (PlayerPrefs.HasKey("save"))
     {
         LoadCurrency(currency);
     }
     if ((PlayerPrefs.HasKey("MainCurrency") && PlayerPrefs.GetString("MainCurrency") == currency.GetName()) || mainCurrency == null)
     {
         ChangeMainCurrency(currency);
     }
 }
Exemplo n.º 3
0
 public void SetCurrency(AbstractCurrency currency)
 {
     this.currency = currency;
 }
Exemplo n.º 4
0
 private void LoadCurrency(AbstractCurrency currency)
 {
     currency.SetAssets(PlayerPrefs.GetFloat(currency.GetName() + "Assets"));
     currency.SetLv(PlayerPrefs.GetInt(currency.GetName() + "Lv"));
     currency.SetPrices(PlayerPrefs.GetString(currency.GetName() + "Prices"));
 }
Exemplo n.º 5
0
 public void ChangeMainCurrency(AbstractCurrency currency)
 {
     mainCurrency = currency;
     Chart.Instance.SetPrices(mainCurrency.GetPrices(), mainCurrency.GetName(), mainCurrency.GetColor());
 }
 public void setPriceAndCurrency(int price, AbstractCurrency c)
 {
     needPrice      = price;
     parentCurrency = c;
     InitializeIfNeeded();
 }