summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2Object.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-06-14 00:50:34 +0100
committerAsh Wolf <ninji@wuffs.org>2023-06-14 00:50:34 +0100
commit37e364b2c6cc7487a1c888d256a73e5337bb7189 (patch)
treeeaf6e857382eef16c2dd940eb4125536fbe068bd /src/T2DLL/T2Object.cpp
downloadt2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.tar.gz
t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.zip
initial commit
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2Object.cpp52
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() {
+}