diff options
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2HaveOutViewObject.cpp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/T2DLL/T2HaveOutViewObject.cpp b/src/T2DLL/T2HaveOutViewObject.cpp new file mode 100644 index 0000000..992d575 --- /dev/null +++ b/src/T2DLL/T2HaveOutViewObject.cpp @@ -0,0 +1,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(int used) { + T2Object::SetUsed(used); + + if (GetToolDef()) { + if (used) + 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; +} |