diff options
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2Object.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/T2DLL/T2Object.cpp b/src/T2DLL/T2Object.cpp new file mode 100644 index 0000000..7336a5a --- /dev/null +++ b/src/T2DLL/T2Object.cpp @@ -0,0 +1,52 @@ +#include "T2Archive.h" +#include "T2Object.h" + +T2Object::T2Object() { + mUsed = false; + mStatus = 0; + mFavorite = false; +} + +/*virtual*/ void T2Object::SetFavorite(BOOL v) { + mFavorite = v; +} + +/*virtual*/ void T2Object::Load(T2Archive& archive, T2TowerDoc* towerDoc) { + LoadSelf(archive, towerDoc); + InitLoaded(); +} + +/*virtual*/ void T2Object::Save(T2Archive& archive) { + SaveSelf(archive); +} + +/*virtual*/ void T2Object::LoadSelf(T2Archive& archive, T2TowerDoc* towerDoc) { + unsigned char b; + short s; + + archive >> b; + mUsed = (b != 0); + + archive >> s; + mStatus = s; + + archive >> b; + mFavorite = (b != 0); +} + +/*virtual*/ void T2Object::SaveSelf(T2Archive& archive) { + unsigned char b; + short s; + + b = (mUsed != 0); + archive << b; + + s = mStatus; + archive << s; + + b = (mFavorite != 0); + archive << b; +} + +/*virtual*/ void T2Object::InitLoaded() { +} |