summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2HaveOutViewObject.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/T2HaveOutViewObject.cpp
downloadt2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.tar.gz
t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.zip
initial commit
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2HaveOutViewObject.cpp68
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;
+}