Esempio n. 1
0
 public static void Initialize(int gold, int hp)
 {
     _gold = gold;
     _hp   = hp;
     _enemiesKilledCount = 0;
     GoldChanges?.Invoke(_gold);
     HpChanges?.Invoke(_hp);
 }
Esempio n. 2
0
 public static bool TrySpendGold(int gold)
 {
     if (_gold - gold >= 0)
     {
         _gold -= gold;
         GoldChanges?.Invoke(_gold);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 3
0
 public static void TryAddGold(int gold)
 {
     _gold += gold;
     GoldChanges?.Invoke(_gold);
 }