summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2Matter.h
blob: 2be5f7d29497db9c16d1039f83f2ac982116a2f1 (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
#ifndef T2DLL_T2MATTER_H
#define T2DLL_T2MATTER_H
#include "../common.h"
#include "T2DrawableObject.h"

class AFX_CLASS_EXPORT T2Matter : public T2DrawableObject {
public:
	T2Matter();

	virtual ~T2Matter();
	virtual void SetUsed(BOOL);
	void Initialize(T2MatterDef*);
	void FlipDirection();
	void SetDestination(unsigned int dstTenant, unsigned int startTime = 0);
	void ClearDestination();
	BOOL IsStartTime(unsigned int) const;
	BOOL IsSetReturn() const;
	BOOL IsSetReturnTime() const;
	unsigned int GetReturnTime() const;
	unsigned int GetReturn() const;
	BOOL SetReturn(unsigned int tenant, unsigned int time = 0);
	void SetReturnTime(unsigned int);
	BOOL PopReturn(unsigned int& outTenant, unsigned int& outTime);
	BOOL SetReturnToDestination();
	BOOL SetDestinationToReturn();
	void DayChanged();
	BOOL RemoveReturn(unsigned int);

	unsigned int GetMatterID() { return mMatterID; }
	T2MatterDef* GetMatterDef() const { return mMatterDef; }
	BOOL IsFront() { return m44 == 0; }
	BOOL IsLast() { return m48 == 0; }
	unsigned int GetWorkTenant() const { return mWorkTenant; }
	unsigned int GetHomeTenant() const { return mHomeTenant; }
	unsigned int GetCurrEquipID() const { return mCurrEquipID; }
	void SetWorkTenant(unsigned int v) { mWorkTenant = v; }
	void SetHomeTenant(unsigned int v) { mHomeTenant = v; }
	void SetCurrEquipID(unsigned int v) { mCurrEquipID = v; }
	unsigned int GetDstTenant() { return mDstTenant; }
	POINT GetCurPosition() const { return mCurPosition; }
	void SetDirection(int v) { mDirection = v; }
	int GetDirection() const { return mDirection; }
	int GetWalkStyle() const { return mWalkStyle; }
	void MoveHTo(int v) { mCurPosition.x = v; }
	void MoveVTo(int v) { mCurPosition.y = v; }
	POINT GetCurrDestPos() const { return mCurrDestPos; }
	void SetCurrDestPos(POINT pt) { mCurrDestPos = pt; }
	BOOL InDestFloor() const {
		return mCurPosition.y == mCurrDestPos.y;
	}
	BOOL IsGoDown() const {
		return (mCurrDestPos.y - mCurPosition.y) > 0;
	}
	BOOL IsSetStartTime() const { return mStartTime > -1; }
	BOOL IsSetDestination() const { return mDstTenant != 0; }
	unsigned int GetDestination() const { return mDstTenant; }
	void SetStartTime(unsigned int v) { mStartTime = v; }

	unsigned int mMatterID;
	T2MatterDef *mMatterDef;
	int m18;
	unsigned int mWorkTenant;
	unsigned int mHomeTenant;
	unsigned int mCurrEquipID;
	unsigned int mDstTenant;
	POINT mCurPosition;
	POINT mCurrDestPos;
	int mStartTime;
	T2ReturnStack *mReturnStack;
	int m44;
	int m48;
	int mDirection;
	int mWalkStyle;

private:
	void Initialize();

protected:
	virtual void LoadSelf(T2Archive&, T2TowerDoc*);
	virtual void SaveSelf(T2Archive&);
};
#endif