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