/// <inheritdoc/>
 public void SendTrigger(Common.GameTrigger trigger)
 {
     if (this.stateMachine != null)
     {
         Console.WriteLine(string.Format("Received trigger {0}", trigger.ToString()));
         this.stateMachine.Fire(trigger);
     }
 }
Beispiel #2
0
 private void ValidateTrigger(Common.GameTrigger trigger, HashSet <Common.GameTrigger> allowedTriggers, string phaseName)
 {
     if (!allowedTriggers.Contains(trigger))
     {
         throw new ArgumentException(
                   string.Format("The UI allowed the user to send the {0} trigger which is not allowed in the {1} phase.", trigger.ToString(), phaseName)
                   );
     }
 }