#pragma once #include "common.h" #include "T2TemplatePlugin.h" enum { kMaxValiation = 4, }; enum { kToolAttrIsMover = 2, kEquipAttrIsAbleDragMaking = 0x80, kToolAttrNormalMenteCost = 0x100, kMoverAttrIsStair = 0x2000, kMoverAttrIsElevator = 0x8000, kMoverAttrRoutingTable0 = 0x1000000, kMoverAttrRoutingTable1 = 0x2000000, kMoverAttrRoutingTable2 = 0x4000000, kMoverAttrRoutingTable3 = 0x8000000, kTenantAttrIsFireproof = 0x1000, kTenantAttrIsFloor = 0x2000, kTenantAttrIsValiableLength = 0x4000, kTenantAttrIsHome = 0x8000, // 10000 kTenantAttrIsConcat = 0x20000, kTenantAttr40000 = 0x40000, // 80000 kTenantAttrOnlyGroundFloor = 0x100000, kTenantAttrOnlyAboveGround = 0x200000, kTenantAttrOnlyUnderground = 0x400000, kTenantAttrIsPeopleAnime = 0x800000, kTenantAttrIsPeopleAnime2 = 0x1000000, kTenantAttrIsNeedToilet = 0x2000000, }; class AFX_CLASS_EXPORT T2ToolDef : public T2TemplatePlugin { public: T2ToolDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFile, T2WorldDef* worldDef, T2ToolPlugin* plugin); virtual ~T2ToolDef(); virtual int GetSortKey(); 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* inDoc, POINT inPt, CString& outSpriteName, RECT& outRect, POINT& outPt, int inZoomLevel, unsigned int inValiation, 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(CResourcePlugin* plugin); virtual void Add(T2AdvertisePlugin* plugin); virtual PROCCODE DrawHitMask(T2TowerDoc*, T2HaveOutViewObject*) { return ProcCode_0; } CFilePluginList* GetSubPluginList() { return mSubPluginList; } 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); protected: friend class T2Mover; friend class T2Settlement; friend class T2TemplatePluginList; friend class T2ToolHelpWnd; friend class T2TowerDoc; int mToolType; int mWidth; int mHeight; int mLevel; unsigned int mAttribute; int mCategoryNo; CString mCategoryName; CString mCategoryCommentString; int mToolNo; int mValiationCount; CString *mPriceString[kMaxValiation]; CString *mOutMoneyString[kMaxValiation]; CString *mCommentString[kMaxValiation]; int mOutMoney[kMaxValiation]; CString *mToolName[kMaxValiation]; CString *mName[kMaxValiation]; int mPrice[kMaxValiation]; T2BitImage *mToolIcon; T2BitImage *mEC; int mConsumptionPower[kMaxValiation]; int mCurBuildCount; int mMaxBuildCount; DWORD mSubPluginType; CFilePluginList *mSubPluginList; int mSettlement; T2DateTime *mToolQuietUntil; T2DateTime *mCategoryQuietUntil; };