summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2HaveOutViewObject.cpp
blob: 1b24415d7be9faffc8547583233f29e9999bb9cc (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "T2HaveOutViewObject.h"
#include "T2ToolDef.h"
#include "T2TowerDoc.h"

T2HaveOutViewObject::T2HaveOutViewObject() {
	mToolDef = NULL;
	mRefCon = 0;
	mSubPlugin = NULL;
	mValiation = 0;
}

/*virtual*/ T2HaveOutViewObject::~T2HaveOutViewObject() {
}

int T2HaveOutViewObject::GetRefCon() {
	return mRefCon;
}

void T2HaveOutViewObject::SetRefCon(int refCon) {
	mRefCon = refCon;
}

CResourcePlugin* T2HaveOutViewObject::GetSubPlugin() const {
	return mSubPlugin;
}

void T2HaveOutViewObject::SetSubPlugin(CResourcePlugin* plugin) {
	mSubPlugin = plugin;
}

T2ToolDef* T2HaveOutViewObject::GetToolDef() const {
	return mToolDef;
}

void T2HaveOutViewObject::SetToolDef(T2ToolDef* toolDef) {
	mToolDef = toolDef;
}

/*virtual*/ void T2HaveOutViewObject::DrawOutView(T2TowerDoc*, const RECT&) {
}

/*virtual*/ void T2HaveOutViewObject::SetUsed(BOOL inUsed) {
	T2Object::SetUsed(inUsed);

	if (GetToolDef()) {
		if (inUsed)
			GetToolDef()->DoStartUse();
		else
			GetToolDef()->DoEndUse();
	}
}

/*virtual*/ void T2HaveOutViewObject::InitLoaded() {
	T2Object::InitLoaded();

	if (IsUsed() && GetToolDef())
		GetToolDef()->DoStartUse();
}

int T2HaveOutViewObject::CalcMentenanceCost(T2TowerDoc* towerDoc) const {
	int cost = 0;
#line 144
	ASSERT(mToolDef);

	cost = mToolDef->CalcMentenanceCostProc(this);
	towerDoc->DoPayTool(cost, 0, mToolDef);
	return cost;
}