Пример #1
0
 private void ValidateEvent(GameStance unexpectedStance)
 {
     if (this.stance == unexpectedStance)
     {
         throw new InvalidOperationException("Event already triggered");
     }
 }
Пример #2
0
 public void TriggerRespawn()
 {
     ValidateEvent(GameStance.Playing);
     _onRespawn.Invoke();
     stance = GameStance.Playing;
 }
Пример #3
0
 public void TriggerDefeat()
 {
     ValidateEvent(GameStance.PausedAfterDefeat);
     _onDefeat.Invoke();
     stance = GameStance.PausedAfterDefeat;
 }