/// <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; } }
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); } }
public void SetCurrency(AbstractCurrency currency) { this.currency = currency; }
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")); }
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(); }