public override void Undo(ref IState state, Edge edge)
        {
            IUndoToken undo = edge.UndoToken;

            state.H = undo.H;
            Array.Reverse(state.Arr, 0, undo.Op.Vals[0] + 1);
        }
예제 #2
0
 public Edge(int cost, Operation op, Operation pop)
 {
     this.op   = op;
     this.cost = cost;
     this.pop  = pop;
     child     = null;
     undoToken = null;
 }
        public override void Undo(ref IState state, Edge edge)
        {
            IUndoToken undo = edge.UndoToken;

            state.H = undo.H;
            Operation op = edge.OP;

            state.Arr[op.Vals[0] - 1] = op.Vals[2];
        }
        public override void Undo(ref IState state, Edge edge)
        {
            IUndoToken undo = edge.UndoToken;

            state.H = undo.H;
            state.Arr[state.Op.Vals[0]] = state.Arr[undo.Op.Vals[0]];
            state.Op = undo.Op;
            state.Arr[undo.Op.Vals[0]] = 0;
        }