#include "saving.hpp" #include "../world/data.hpp" #include "../world/idcollection.hpp" #include "state.hpp" #include "savingstages.hpp" #include "document.hpp" CSMDoc::Saving::Saving (Document& document) : Operation (State_Saving, true, true), mDocument (document), mState (*this) { appendStage (new OpenSaveStage (mDocument, mState)); appendStage (new WriteHeaderStage (mDocument, mState)); appendStage (new WriteCollectionStage > (mDocument.getData().getGlobals(), mState)); appendStage (new WriteCollectionStage > (mDocument.getData().getGmsts(), mState)); appendStage (new WriteCollectionStage > (mDocument.getData().getSkills(), mState)); appendStage (new WriteCollectionStage > (mDocument.getData().getClasses(), mState)); appendStage (new WriteCollectionStage > (mDocument.getData().getFactions(), mState)); appendStage (new WriteCollectionStage > (mDocument.getData().getRaces(), mState)); appendStage (new WriteCollectionStage > (mDocument.getData().getSounds(), mState)); appendStage (new WriteCollectionStage > (mDocument.getData().getScripts(), mState)); appendStage (new WriteCollectionStage > (mDocument.getData().getRegions(), mState)); appendStage (new WriteCollectionStage > (mDocument.getData().getBirthsigns(), mState)); appendStage (new WriteCollectionStage > (mDocument.getData().getSpells(), mState)); appendStage (new CloseSaveStage (mState)); appendStage (new FinalSavingStage (mDocument, mState)); }