Rename osx directory to src since it's now the official source base

This commit is contained in:
2014-12-28 12:12:38 -05:00
parent ca15b2781e
commit af0ee110c6
228 changed files with 0 additions and 0 deletions

40
src/tools/undo.cpp Normal file
View File

@@ -0,0 +1,40 @@
/*
* undo.cpp
* BoE
*
* Created by Celtic Minstrel on 29/05/09.
*
*/
#include "undo.h"
cUndoList::cUndoList(){
lastSave = cur = theList.begin();
}
size_t cUndoList::maxUndoSize = 0;
//TODO: These functions should have error checking to ensure they do not access an out of bounds action
void cUndoList::undo(){
(*cur)->undo();
cur--;
}
void cUndoList::redo(){
cur++;
(*cur)->redo();
}
void cUndoList::save(){
lastSave = cur;
}
void cUndoList::revert(){
while(cur != lastSave) undo();
}
void cUndoList::add(cAction* what){
theList.push_back(what);
num_actions++;
while(num_actions > maxUndoSize) theList.pop_front(), num_actions--;
}