MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / undo

Method undo

Engine/source/gui/worldEditor/undoActions.cpp:70–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void MECreateUndoAction::undo()
71{
72 for ( S32 i= mObjects.size()-1; i >= 0; i-- )
73 {
74 ObjectState &state = mObjects[i];
75
76 SimObject *object = Sim::findObject( state.id );
77 if ( !object )
78 continue;
79
80 // Save the state.
81 if ( !state.memento.hasState() )
82 state.memento.save( object );
83
84 // Store the group.
85 SimGroup *group = object->getGroup();
86 if ( group )
87 state.groupId = group->getId();
88
89 // We got what we need... delete it.
90 object->deleteObject();
91 }
92
93 Con::executef( this, "onUndone" );
94}
95
96void MECreateUndoAction::redo()
97{

Callers

nothing calls this directly

Calls 15

executefFunction · 0.85
dStricmpFunction · 0.85
hasStateMethod · 0.80
getDataFieldMethod · 0.80
getIdMethod · 0.65
findObjectFunction · 0.50
sizeMethod · 0.45
saveMethod · 0.45
getGroupMethod · 0.45
deleteObjectMethod · 0.45
restoreMethod · 0.45
addObjectMethod · 0.45

Tested by

no test coverage detected