Ejemplo n.º 1
0
        public List <StateEvent> ProcessCommand(IStateCommandProtocol command)
        {
            var ev = new List <StateEvent>();

            _currentLeaf = _currentLeaf.ProcessCommand(command, ev);
            return(ev);
        }
Ejemplo n.º 2
0
        public StateLeaf ProcessCommand(IStateCommandProtocol command, List <StateEvent> events)
        {
            var nextState = command.Process(State, events);
            var next      = new StateLeaf(nextState);

            next._previousLeaf = this;
            this._nextLeaf     = next;
            return(next);
        }
Ejemplo n.º 3
0
 public bool Redo()
 {
     if (CanRedo)
     {
         _currentLeaf = _currentLeaf.Redo();
         return(true);
     }
     return(false);
 }
Ejemplo n.º 4
0
 public bool Undo()
 {
     if (CanUndo)
     {
         _currentLeaf = _currentLeaf.Undo();
         return(true);
     }
     return(false);
 }
Ejemplo n.º 5
0
 public StateTree(IStateProtocol state)
 {
     _root        = new StateLeaf(state);
     _currentLeaf = _root;
 }