From 5c6a48b2ff362a70416a6a00fda7d06e0f276f2d Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Sat, 1 Jul 2023 02:43:29 +0100 Subject: i am in hell --- src/T2DLL/T2ToolDef.h | 63 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 25 deletions(-) (limited to 'src/T2DLL/T2ToolDef.h') diff --git a/src/T2DLL/T2ToolDef.h b/src/T2DLL/T2ToolDef.h index 19caf2a..830dc92 100644 --- a/src/T2DLL/T2ToolDef.h +++ b/src/T2DLL/T2ToolDef.h @@ -30,7 +30,7 @@ enum { kTenantAttrIsNeedToilet = 0x2000000, }; -class AFX_EXT_CLASS T2ToolDef : public T2TemplatePlugin { +class AFX_CLASS_EXPORT T2ToolDef : public T2TemplatePlugin { public: T2ToolDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFile, T2WorldDef* worldDef, T2ToolPlugin* plugin); virtual ~T2ToolDef(); @@ -38,21 +38,55 @@ public: virtual BOOL IsMover() { return false; } virtual BOOL IsTenant() { return false; } virtual BOOL IsOutObj() { return false; } + + 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 = *mName[id]; + } + + void GetCategoryName(CString outStr) const { + // BUG: outStr should be & + outStr = mCategoryName; + } + 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; + + 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--; } + virtual void LoadExtraData(T2Archive&, T2TowerDoc*, T2HaveOutViewObject*) {} virtual void SaveExtraData(T2Archive&, T2HaveOutViewObject*) {} virtual void Add(T2AdvertisePlugin* plugin); @@ -60,6 +94,9 @@ public: virtual PROCCODE DrawHitMask(T2TowerDoc*, T2HaveOutViewObject*) { return ProcCode_0; } + + CFilePluginList* GetSubPluginList() { return mSubPluginList; } + virtual unsigned long OptionProc(unsigned long, void*) { return 0; } @@ -69,30 +106,6 @@ public: 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 = *mName[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: friend class T2Mover; friend class T2Settlement; -- cgit v1.2.3