From 37e364b2c6cc7487a1c888d256a73e5337bb7189 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 14 Jun 2023 00:50:34 +0100 Subject: initial commit --- src/T2DLL/T2Object.cpp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/T2DLL/T2Object.cpp (limited to 'src/T2DLL/T2Object.cpp') 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() { +} -- cgit v1.2.3