- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/WorldAction/BoundInBoxAction.cpp
r623e89 r047878 6 6 */ 7 7 8 #include "Helpers/MemDebug.hpp" 9 8 10 #include "Actions/WorldAction/BoundInBoxAction.hpp" 11 #include "Actions/ActionRegistry.hpp" 9 12 #include "log.hpp" 10 13 #include "molecule.hpp" … … 19 22 #include "UIElements/UIFactory.hpp" 20 23 #include "UIElements/Dialog.hpp" 21 #include " Actions/MapOfActions.hpp"24 #include "UIElements/ValueStorage.hpp" 22 25 23 26 const char WorldBoundInBoxAction::NAME[] = "bound-in-box"; … … 30 33 {} 31 34 35 void WorldBoundInBox() { 36 ActionRegistry::getInstance().getActionByName(WorldBoundInBoxAction::NAME)->call(Action::NonInteractive); 37 }; 38 39 Dialog* WorldBoundInBoxAction::fillDialog(Dialog *dialog) { 40 ASSERT(dialog,"No Dialog given when filling action dialog"); 41 42 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); 43 44 return dialog; 45 } 46 32 47 Action::state_ptr WorldBoundInBoxAction::performCall() { 33 Dialog *dialog = UIFactory::getInstance().makeDialog();34 48 35 dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME)); 36 37 if(dialog->display()) { 38 // center 39 vector<molecule*> AllMolecules = World::getInstance().getAllMolecules(); 40 for (vector<molecule*>::iterator MolRunner = AllMolecules.begin(); MolRunner != AllMolecules.end(); ++MolRunner) { 41 (*MolRunner)->BoundInBox(); 42 } 43 delete dialog; 44 return Action::success; 45 } else { 46 delete dialog; 47 return Action::failure; 49 // center 50 vector<molecule*> AllMolecules = World::getInstance().getAllMolecules(); 51 for (vector<molecule*>::iterator MolRunner = AllMolecules.begin(); MolRunner != AllMolecules.end(); ++MolRunner) { 52 (*MolRunner)->BoundInBox(); 48 53 } 54 return Action::success; 49 55 } 50 56
Note:
See TracChangeset
for help on using the changeset viewer.