#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; }