Changeset c8165c for src/Actions/WorldAction/StepWorldTimeAction.cpp
- Timestamp:
- May 8, 2017, 2:01:48 PM (8 years ago)
- Branches:
- ForceAnnealing_goodresults, ForceAnnealing_tocheck
- Children:
- db0833
- Parents:
- 73faf4 (diff), c1446cd (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/Actions/WorldAction/StepWorldTimeAction.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/WorldAction/StepWorldTimeAction.cpp
r73faf4 rc8165c 47 47 using namespace MoleCuilder; 48 48 49 // if both are given, we use backwards50 static int getSteps(const unsigned int _forward, const unsigned int _backward)51 {52 int steps = 0;53 if (_backward > 0)54 steps = -_backward;55 else56 steps = _forward;57 58 return steps;59 }60 61 49 // and construct the stuff 62 50 #include "StepWorldTimeAction.def" … … 69 57 WorldStepWorldTimeState *UndoState = new WorldStepWorldTimeState(oldtime, params); 70 58 71 const int steps = getSteps(params.steps_forward.get(), params.steps_backward.get()); 72 73 if ((oldtime + steps) < 0) { 59 if ((oldtime + params.steps.get()) < 0) { 74 60 ELOG(1, "Cannot step back before time step #0."); 75 61 delete UndoState; 76 62 return Action::failure; 77 63 } 78 World::getInstance().setTime(oldtime+ steps);64 World::getInstance().setTime(oldtime+params.steps.get()); 79 65 LOG(0, "Current time step is now: " << WorldTime::getTime() << "."); 80 66 return ActionState::ptr(UndoState); … … 93 79 WorldStepWorldTimeState *state = assert_cast<WorldStepWorldTimeState*>(_state.get()); 94 80 95 const int steps = getSteps( 96 state->params.steps_forward.get(), 97 state->params.steps_backward.get()); 98 99 World::getInstance().setTime(state->oldtime+steps); 81 World::getInstance().setTime(state->oldtime+state->params.steps.get()); 100 82 LOG(0, "Current time step is now: " << WorldTime::getTime() << "."); 101 83
Note:
See TracChangeset
for help on using the changeset viewer.
