summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2Object.cpp
blob: 3c52d9a6daba7faba1ce43725b429ed2b2514ff8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "T2Archive.h"
#include "T2Object.h"

T2Object::T2Object() {
	mUsed = false;
	mStatus = kStatus0;
	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() {
}