/// <summary> /// Добавить золото /// </summary> /// <param name="amount">Количество</param> public void AddGold(int amount) { // Расшифровываем string decodingGold = B64X.Decode(currentGold); int existsGold = int.Parse(decodingGold); // Прибавляем existsGold += amount; // Кодируем обратно string encodingGold = B64X.Encode(existsGold.ToString()); currentGold = encodingGold; OnGoldChange.Invoke(); }
/// <summary> /// Golds the change notify. /// </summary> /// <param name="oldGold">The old gold.</param> private void GoldChangeNotify(long oldGold) { OnGoldChange?.Invoke(new ChangedValue <long>(oldGold, this.gold)); }