summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2Equip.h
blob: 923d4ef3d1a76d5d817d8a6d38854cbff6d66af5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#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