summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2ToolDef.h
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/T2ToolDef.h
downloadt2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.tar.gz
t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.zip
initial commit
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2ToolDef.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/T2DLL/T2ToolDef.h b/src/T2DLL/T2ToolDef.h
new file mode 100644
index 0000000..f5cb467
--- /dev/null
+++ b/src/T2DLL/T2ToolDef.h
@@ -0,0 +1,96 @@
+#pragma once
+#include "common.h"
+#include "T2TemplatePlugin.h"
+
+class T2ToolDef : public T2TemplatePlugin {
+public:
+ T2ToolDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFile, T2WorldDef* worldDef, T2ToolPlugin* plugin);
+ virtual ~T2ToolDef();
+ virtual int GetSortKey();
+ virtual int IsMover() { return 0; }
+ virtual int IsTenant() { return 0; }
+ virtual int IsOutObj() { return 0; }
+ virtual int CalcPayment(T2TowerDoc*, RECT&, unsigned int id) {
+ return mPrice[id];
+ }
+ virtual int RequierToolIcon(T2ToolWindow*) {
+ return 0;
+ }
+ virtual CURSORTYPE QueryCursor(T2TowerDoc*, POINT, CString&, RECT&, POINT&, int, unsigned int, int);
+ virtual unsigned int IdleProc(T2HaveOutViewObject*, T2TowerDoc*) {
+ return 0;
+ }
+ virtual void DefIdleProc(T2TowerDoc*) {}
+ virtual void DrawProc(T2HaveOutViewObject*, const RECT&, T2TowerDoc*) const {}
+ virtual PROCCODE DoDestructProc(T2TowerDoc*, T2HaveOutViewObject*, POINT, RECT&);
+ virtual void DestructFinish(T2TowerDoc*, T2HaveOutViewObject*) {}
+ virtual int CalcMentenanceCostProc(const T2HaveOutViewObject*) const;
+ virtual void LoadExtraData(T2Archive&, T2TowerDoc*, T2HaveOutViewObject*) {}
+ virtual void SaveExtraData(T2Archive&, T2HaveOutViewObject*) {}
+ virtual void Add(T2AdvertisePlugin* plugin);
+ virtual void Add(CResourcePlugin* plugin);
+ virtual PROCCODE DrawHitMask(T2TowerDoc*, T2HaveOutViewObject*) {
+ return ProcCode_0;
+ }
+ virtual unsigned long OptionProc(unsigned long, void*) {
+ return 0;
+ }
+
+ CString CalcSoundID(int) const;
+ void GetName(CString& outStr, int id);
+ int GetOutMoney(unsigned int id) const;
+ void SetOutMoney(unsigned int id, int money);
+
+ int GetToolNo() const { return mToolNo; }
+ int GetCategory() const { return mCategoryNo; }
+ int GetToolType() const { return mToolType; }
+ int IsSetAttribute(unsigned int a) const { return (mAttribute & a) != 0; }
+ DWORD GetSubPluginType() const { return mSubPluginType; }
+ unsigned int GetAttribute() const { return mAttribute; }
+ T2BitImage* GetToolIcon() const { return mToolIcon; }
+ void GetToolName(CString& outStr, int id) const {
+ outStr = *mNames[id];
+ }
+ void GetCategoryName(CString outStr) const {
+ // BUG: outStr should be &
+ outStr = mCategoryName;
+ }
+ int GetConsumptionPower(unsigned int id) {
+ return mConsumptionPower[id];
+ }
+ int GetCurBuildCount() const { return mCurBuildCount; }
+ int GetMaxBuildCount() const { return mMaxBuildCount; }
+ int GetSettlement() const { return mSettlement; }
+ void DoStartUse() { mCurBuildCount++; }
+ void DoEndUse() { mCurBuildCount--; }
+ CFilePluginList* GetSubPluginList() { return mSubPluginList; }
+
+protected:
+ int mToolType;
+ int mWidth;
+ int mHeight;
+ int mLevel;
+ unsigned int mAttribute;
+ int mCategoryNo;
+ CString mCategoryName;
+ CString mCategoryCommentString;
+ int mToolNo;
+ int mValiationCount;
+ CString *mPriceString[4];
+ CString *mOutMoneyString[4];
+ CString *mCommentString[4];
+ int mOutMoney[4];
+ CString *mToolName[4];
+ CString *mName[4];
+ int mPrice[4];
+ T2BitImage *mToolIcon;
+ T2BitImage *mEC;
+ int mConsumptionPower[4];
+ int mCurBuildCount;
+ int mMaxBuildCount;
+ DWORD mSubPluginType;
+ CFilePluginList *mSubPluginList;
+ int mSettlement;
+ void *m114; // TODO what am i?
+ int m118;
+};