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