public void saveState(StateChange state)
 {
     if (state == null)
     {
         throw new ArgumentNullException();
     }
     removeStatesAfter(currentState);
     savedStates.AddLast(state);
     currentState = savedStates.Last;
 }
Example #2
0
        private void startStateChange(IEnumerable<RigidBody> bodies)
        {
            //if (bodies == null)
            //    Console.WriteLine("start with body count:    null");
            //else
            //    Console.WriteLine("start with body count:    " + bodies.Count());

            stateInChange = new StateChange(bodies);
        }
Example #3
0
 private void undo()
 {
     if (moveMode != MoveMode.None)
     {
         finishStateChange(selected); //in case of dragging
     }
     Paused = true;
     selected.Clear();
     stateInChange = states.undo();
 }
Example #4
0
 private void finishStateChange(IEnumerable<RigidBody> bodies)
 {
     moveMode = MoveMode.None;
     if (stateInChange != null)
     {
         stateInChange.After = bodies;
         states.saveState(stateInChange);
         stateInChange = null;
     }
     //if (selectedButNotMoving.Count != 0)
     //{
     //    selected.Add(selectedButNotMoving);
     //    selectedButNotMoving = Selection.Empty;
     //}
 }