summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2Transport.h
blob: 28e33592aab8098fad958571f86d78b3d262c57e (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
#ifndef T2DLL_T2TRANSPORT_H
#define T2DLL_T2TRANSPORT_H
#include "../common.h"

class AFX_CLASS_EXPORT T2Transport {
public:
	T2Transport();
	virtual ~T2Transport();
	void Init(T2Transport* inParent, CResFile* inResFile);
	void Init(T2Transport* inParent, int inArriveTime);
	void AddTransport(T2Transport* inTransport);
	int GetNofTimeTable();
	void SetStation(unsigned int inStation);
	void UpGrade(int inGrade);
	int GetTrainType(int inIndex) const;
	unsigned int GetArriveTime(int inIndex) const;
	T2Transport* GetStoppage() const;
	BOOL WasStoppage() const;
	T2Transport* GetAvailable(T2DateTime* inDateTime) const;
	BOOL Enter(CLink* inLink);
	BOOL Leave(CLink* inLink);
	CLink* LeaveFirst();
	BOOL IsFull() const { return mNumOfContents >= mCapacity; }

	virtual int Stop(T2TowerDoc* inDoc);
	virtual void Read(T2Archive& inArchive);
	virtual void Write(T2Archive& inArchive);

private:
	void Initialize();
	virtual void DoSetStatus(int inStatus) = 0;
	virtual T2TowerDoc *DoGetTowerDoc() const = 0;
	virtual int DoGetBeginTime() = 0;
	virtual T2WorldDef *DoGetWorldDef() = 0;

protected:
	BOOL ChkStoppage() const;
	T2Transport* GetIndObject(int inIndex) const;
	BOOL IsAvailable(T2DateTime* inDateTime);

	T2Transport *mParent;
	LArray *mArray;
	int _C;
	unsigned int mWidth;
	int _14;
	unsigned int mStation;
	int mGrade;
	int mTrainType;
	int _24;
	unsigned int mArriveTime;
	unsigned int _2C;
	BOOL mFlag;
	unsigned int mCapacity;
	unsigned int mNumOfContents;
	CLink *mFirstLink;
	CLink *mLastLink;
};
#endif