#ifndef T2DLL_T2EQUIP_H #define T2DLL_T2EQUIP_H #include "../common.h" #include "T2EquipDef.h" #include "T2HaveOutViewObject.h" class AFX_CLASS_EXPORT T2Equip : public T2HaveOutViewObject { public: T2Equip(); virtual ~T2Equip(); unsigned int GetAttribute() const { return mAttribute; } int IsSetAttribute(unsigned int a) const { return (mAttribute & a) != 0; } int IsMover() const { return IsSetAttribute(kToolAttrIsMover); } int IsNormalMenteCost() const { return IsSetAttribute(kToolAttrNormalMenteCost); } virtual void SetUsed(BOOL inUsed); virtual T2InfoDialog* ShowInfoDialog(T2TowerDoc*); virtual void DrawHitMask(T2TowerDoc*); virtual int IsNeedDraw() const { return true; } virtual int GetOutMoney() const; virtual int GetInMoney() const; unsigned int GetEquipID() const { return mEquipID; } void SetEquipDef(T2EquipDef* equipDef) { SetToolDef(equipDef); } void GetEquipArea(RECT& rect) const { rect = mArea; } int GetAreaWidth() const { return mArea.right - mArea.left; } int GetAreaHeight() const { return mArea.bottom - mArea.top; } int GetEquipType() const { return mEquipType; } int GetCapacity() const { return mCapacity; } int GetInMoneyIndex() const { return mInMoneyIndex; } virtual void BuildStart(T2TowerDoc*) {} virtual int IsBuildFinish() { return true; } int GetBuildDay() const { return mBuildDay; } virtual PARTCODE GetPartFromPoint(T2TowerDoc*, POINT, int*); virtual PARTCODE GetClickPart(T2TowerDoc*, CPoint, int*); virtual PROCCODE DoDestruct(T2TowerDoc*, POINT, RECT&); virtual void SetDrawMode(int drawMode); virtual void ClearDrawMode(); int GetDrawMode() const; virtual void PlaySound(T2TowerDoc*, int, unsigned int, unsigned int) const; int InitEquip(T2EquipDef* def, const RECT& area, unsigned int valiation); int DaysSinceBuilt(const T2TowerDoc*) const; void SetEquipArea(const RECT&); T2CrossEquipArray* GetCEArray() const; void InsertCEID(int, int); void RemoveCEID(int); void ReplaceCEID(unsigned int, unsigned int); void GetTypicalName(CString&) const; T2EquipDef* GetEquipDef() const; void SetInMoneyIndex(int i); int GetPatIndex() const; void SetPatIndex(int i); unsigned int mEquipID; RECT mArea; int mEquipType; int mDrawMode; int mPatIndex; int mCapacity; int m44; int m48; int mBuildDay; unsigned int mAttribute; T2CrossEquipArray *mCEArray; int m58; int mInMoneyIndex; protected: virtual void LoadSelf(T2Archive&, T2TowerDoc*); virtual void SaveSelf(T2Archive&); }; inline /*virtual*/ void T2Equip::SetDrawMode(int drawMode) { if (mDrawMode != drawMode) mDrawMode = drawMode; } inline /*virtual*/ void T2Equip::ClearDrawMode() { mDrawMode = DrawMode0; } inline int T2Equip::GetDrawMode() const { return mDrawMode; } inline T2CrossEquipArray* T2Equip::GetCEArray() const { return mCEArray; } inline T2EquipDef* T2Equip::GetEquipDef() const { return (T2EquipDef *) mToolDef; } inline void T2Equip::SetInMoneyIndex(int i) { mInMoneyIndex = i; } inline int T2Equip::GetPatIndex() const { return mPatIndex; } inline void T2Equip::SetPatIndex(int i) { mPatIndex = i; } #endif