#pragma once #include "common.h" #include "T2EquipDef.h" #include "T2HaveOutViewObject.h" #include "T2RouteCEArray.h" class AFX_EXT_CLASS T2Equip : public T2HaveOutViewObject { public: T2Equip(); virtual ~T2Equip(); virtual void SetUsed(int); virtual T2InfoDialog* ShowInfoDialog(T2TowerDoc*); virtual void DrawHitMask(T2TowerDoc*); virtual int IsNeedDraw() const { return true; } virtual int GetOutMoney() const; virtual int GetInMoney() const; virtual void BuildStart(T2TowerDoc*) {} virtual int IsBuildFinish() { return true; } virtual PARTCODE GetPartFromPoint(T2TowerDoc*, POINT, int*); virtual PARTCODE GetClickPart(T2TowerDoc*, CPoint, int*); virtual PROCCODE DoDestruct(T2TowerDoc*, POINT, RECT&); virtual void SetDrawMode(int drawMode) { if (mDrawMode != drawMode) mDrawMode = drawMode; } virtual void ClearDrawMode() { mDrawMode = DrawMode0; } 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&); void InsertCEID(int, int); void RemoveCEID(int); void ReplaceCEID(unsigned int, unsigned int); void GetTypicalName(CString&) const; 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); } 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; } int GetBuildDay() const { return mBuildDay; } int GetDrawMode() const { return mDrawMode; } T2CrossEquipArray* GetCEArray() const { return mCEArray; } T2EquipDef* GetEquipDef() const { return (T2EquipDef *) mToolDef; } void SetInMoneyIndex(int i) { mInMoneyIndex = i; } int GetPatIndex() const { return mPatIndex; } void SetPatIndex(int i) { mPatIndex = 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&); };