#pragma once #include "common.h" class AFX_EXT_CLASS 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; };