summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2MoverModule.h
blob: 72ce952697e53c61e5fe203938341371a8614308 (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
#ifndef T2DLL_T2MOVERMODULE_H
#define T2DLL_T2MOVERMODULE_H
#include "../common.h"
#include "LBroadcaster.h"
#include "T2DrawableObject.h"

// unknown name
struct T2MoverModuleMessageData {
    T2MoverModule *moverModule;
    int value;
};

class AFX_CLASS_EXPORT T2MoverModule : public T2DrawableObject, public LBroadcaster {
public:
	T2MoverModule();
	virtual ~T2MoverModule();
	virtual void SetUsed(BOOL used);
	virtual void RemoveContents(T2TowerDoc*);
	virtual void StopAdded(T2TowerDoc*, T2Mover*, int);
	virtual void StopRemoved(T2TowerDoc*, T2Mover*, int);
    virtual void Enter(T2Mover*, T2People*);
    virtual BOOL Enter(CLink* link);
    virtual BOOL Leave(CLink* link);

    void SetDirection(int);
    void AddPosition(int);
    void SetModuleID(T2TowerDoc*);

    unsigned int GetModuleID() const { return mModuleID; }
    int GetPosition() const { return mPosition; }
    int GetDirection() const { return mDirection; }
    int GetWaitCounter() const { return mWaitCounter; }
    void SetWaitCounter(int v) { mWaitCounter = v; }
    void SubWaitCounter(int v) { mWaitCounter -= v; }
    int GetPatIndex() const { return mPatIndex; }
    void SetPatIndex(int v) { mPatIndex = v; }
    int GetNumPeople() const { return mNumPeople; }

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

    friend class T2StairModuleList;
    friend class T2Mover;

    int mPosition;
    int mDirection;
    int mWaitCounter;
    int mPatIndex;
    int mNumPeople;
    int _4C;
    unsigned int mModuleID;
    // which one of these is first and which one is last?
    CLink *mLink1;
    CLink *mLink2;

private:
    static unsigned int GetNewModuleID(T2TowerDoc*);
	static unsigned int sModuleID;
};
#endif