Esempio n. 1
0
    /// <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();
    }
Esempio n. 2
0
 /// <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));
 }