Пример #1
0
 public void AddAgeAndCheckStatus(int amount)
 {
     if (_petStatus.Age <= _petStatus.MaxAge)
     {
         _petStatus.Age = +amount;
     }
     else
     {
         PetHasDied?.Invoke();
     }
 }
Пример #2
0
 public void ReduceLoveAndCheckStatus(int amount)
 {
     if (_petStatus.Love - amount > 0)
     {
         _petStatus.Love = -amount;
     }
     else
     {
         // later add timer so it doesn't die instantly
         PetHasDied?.Invoke();
     }
 }
Пример #3
0
 public void AddHungerAndCheckStatus(int amount)
 {
     if (_petStatus.Hunger - amount > 0)
     {
         _petStatus.Hunger = _petStatus.Hunger - amount;
     }
     else
     {
         // later add timer so it doesn't die instantly
         PetHasDied?.Invoke();
     }
 }