summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2EquipDef.h
blob: 93f2290b685e3bb96fa89e3a9a2b2b9b1888e9d2 (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
#ifndef T2DLL_T2EQUIPDEF_H
#define T2DLL_T2EQUIPDEF_H
#include "../common.h"
#include "T2ToolDef.h"

class AFX_CLASS_EXPORT T2EquipDef : public T2ToolDef {
public:
	T2EquipDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFile, T2WorldDef* worldDef, T2EquipPlugin* plugin);
	virtual ~T2EquipDef();
	virtual BOOL InitObject(T2Object*);

    BOOL IsSetAttribute(unsigned int a) {
        return (mAttribute & a) != 0;
    }
    virtual BOOL IsMover() { return IsSetAttribute(kToolAttrIsMover); }
    BOOL IsAbleDragMaking() { return IsSetAttribute(kEquipAttrIsAbleDragMaking); }
    int GetNumOfInMoney() const { return mNumOfInMoney; }

	virtual void LoadExtraData(T2Archive& inArchive, T2TowerDoc*, T2HaveOutViewObject*);
	virtual void SaveExtraData(T2Archive& inArchive, T2HaveOutViewObject*);
	virtual AREACHECKCODE AreaCheck(T2TowerDoc* inDoc, RECT& inRect, unsigned int, BOOL inShowError);
	virtual int ClickProc(T2TowerDoc*, RECT*, unsigned int&);
	virtual int GetDestructPartProc(int, POINT, POINT, T2Equip*);
	virtual PARTCODE GetPartFromPoint(T2TowerDoc*, T2Equip*, POINT, int*);
    virtual PROCCODE DoBuildProc(T2TowerDoc*, RECT&, unsigned int) {
        return ProcCode_0;
    }
    virtual BOOL FingerToolProc(T2TowerDoc*, T2Equip*, const POINT&, MOUSEEVENT);
	virtual void BuildFinish(T2TowerDoc*, T2Equip*);
	virtual unsigned long OptionProc(T2TowerDoc*, T2Equip*, void*);
	virtual void DrawPeople(T2TowerDoc* inDoc, T2Equip* inEquip);
	virtual int GetInfoDialogID(T2TowerDoc*, const T2Equip*) const;
	virtual T2InfoDialog* ShowInfoDialog(T2TowerDoc*, T2Equip*);
	virtual T2InfoDialog* ConstructInfoDialog(T2Equip*);

    virtual int EmergencyProc(T2TowerDoc*, T2Equip*) {
        return DrawMode0;
    }
    virtual int BurntDownProc(T2TowerDoc*, T2Equip*) {
        return 0;
    }

    virtual void DebugInfo(CWnd&, CListCtrl&, T2Equip*);

	int GetInMoney(int);
	void GetWords(T2People*, CString&) const;

	int GetEquipType() const;
	void CalcEquipRect(RECT& rect) const;
	int GetCapacity() const;
	unsigned int GetAttribute() const;

protected:
	T2WordDefArray* MakeWordDefArray();

    friend class T2People;

	int mCapacity;
	int mStress;
	T2BitImage *m124;
	T2BitImage *m128;
	T2WordDefArray *mWordDefArray;
	T2BitImage *m130;
	int mOutSpan;
	int mInSpan;
	int mNumOfInMoney;
	int m140;
	int mInMoney[4];
	int m154;
};

inline int T2EquipDef::GetEquipType() const { return mToolType; }
inline void T2EquipDef::CalcEquipRect(RECT& rect) const {
    rect.top = 0;
    rect.left = 0;
    rect.bottom = mHeight;
    rect.right = mWidth;
}
inline int T2EquipDef::GetCapacity() const { return mCapacity; }
inline unsigned int T2EquipDef::GetAttribute() const { return mAttribute; }
#endif