Ejemplo n.º 1
0
 public AttemptedTransitionDuringTransitionException(TState from, TState to, Transition currentTransition) :
     base($"Attempted Transition from '{from.ToString()}' to '{to.ToString()}' during Transition  '{currentTransition.from.ToString()}' to '{currentTransition.to.ToString()}S'")
 {
     this.From = from;
     this.To   = to;
     this.CurrentTransition = currentTransition;
 }
Ejemplo n.º 2
0
 public override string ToString()
 {
     if (IsDirty)
     {
         return("Dirty");
     }
     else if (MultilineToken)
     {
         return("Multiline");
     }
     else
     {
         return(EndLineState.ToString());
     }
 }
Ejemplo n.º 3
0
 public void MakeMove(IPlayer user, IGridPoint point)
 {
     if (user.Assignment.ToString() == TState.ToString())
     {
         //Move permitted, check Location
         if (GameGrid.CheckOpenLocation(point))
         {
             point.SetOwnership(user);
             GameGrid.CommitAndUpdateBoard(user);
         }
         else
         {
             throw new ArgumentException();
         }
     }
 }
Ejemplo n.º 4
0
 public InvalidTransitionException(TState from, TState to) : base($"Invalid transition from '{from.ToString()}' to '{to.ToString()}'")
 {
     From = from;
     To   = to;
 }
Ejemplo n.º 5
0
 public InvalidStateException(TState state, TState to) : base($"Invalid state '{state.ToString()}'")
 {
     State = state;
 }