diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-06-28 22:22:32 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-06-28 22:22:32 +0100 |
commit | c0c336500955a23e344651e5412c9d9d441ef4ee (patch) | |
tree | 790769c748db307cf3314f6e896e2f61c68561a2 /src/T2DLL/T2Mover.h | |
parent | 37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff) | |
download | t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip |
first pass of T2DLL
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2Mover.h | 113 |
1 files changed, 64 insertions, 49 deletions
diff --git a/src/T2DLL/T2Mover.h b/src/T2DLL/T2Mover.h index 18326bd..f4979dd 100644 --- a/src/T2DLL/T2Mover.h +++ b/src/T2DLL/T2Mover.h @@ -1,71 +1,86 @@ #pragma once #include "common.h" +#include "T2Equip.h" -class T2Mover { +enum { + kMoverStatus0 = 0, + kMoverStatus9 = 9 +}; + +class AFX_EXT_CLASS T2Mover : public T2Equip { public: T2Mover(); virtual ~T2Mover(); - virtual void SetUsed(int); - int InitMover(T2MoverDef*, const RECT&, unsigned int); - int InitStair(T2MoverDef*, const RECT&, unsigned int); - int InitElevator(T2MoverDef*, const RECT&, unsigned int); + virtual void SetUsed(BOOL); + virtual BOOL Enter(CLink*) { return false; } + virtual BOOL Leave(CLink*) { return false; } + virtual unsigned int Idle(T2TowerDoc*); + virtual void Draw(T2TowerDoc*, const RECT&); + virtual BOOL IsBuildFinish() { return mStatus >= kMoverStatus9; } + virtual PROCCODE DoDestruct(T2TowerDoc*, POINT, RECT&); + virtual BOOL Destruct(T2TowerDoc*, CRect&); + virtual T2InfoDialog* ShowInfoDialog(T2TowerDoc*, CPoint); + + BOOL InitMover(T2MoverDef* moverDef, const RECT& baseRect, unsigned int valiation); + BOOL InitStair(T2MoverDef* moverDef, const RECT& baseRect, unsigned int valiation); + BOOL InitElevator(T2MoverDef* moverDef, const RECT& baseRect, unsigned int valiation); void GetTypicalName(CString&) const; - virtual PROCCODE DoDestruct(T2TowerDoc*, POINT, RECT&); - virtual int Destruct(T2TowerDoc*, CRect&); - virtual void Draw(T2TowerDoc*, const RECT&); int GetNumStop() const; - void AddStopBoth(T2TowerDoc*, int); - int AddStop(T2FloorInfo*, int, ERequestUpDown); - void RemoveStopBoth(T2TowerDoc*, int); - void RemoveStop(T2TowerDoc*, int, ERequestUpDown); - void RemoveCrossEquipID(T2FloorInfo*, int); - void RemoveUnstoppable(T2TowerDoc*); - void AddCrossEquipID(T2FloorInfo*, int); - void AddCEFloorID(T2FloorInfo*, int); - void ReplaceID(T2FloorInfo*, unsigned int); - POINT PositionToStopPt(int, ERequestUpDown); - int UnitToPosition(int) const; - int PositionToUnit(int) const; - int IsStopPosition(int) const; - int IsStopPosition(int, ERequestUpDown); - int AddModule(T2TowerDoc*, int); - void AddStairModule(T2TowerDoc*, const RECT&, int); - unsigned int GetRequestID(int, int) const; + void AddStopBoth(T2TowerDoc* towerDoc, int position); + BOOL AddStop(T2FloorInfo* floorInfo, int position, ERequestUpDown upDown); + void RemoveStopBoth(T2TowerDoc* towerDoc, int position); + void RemoveStop(T2TowerDoc* towerDoc, int position, ERequestUpDown upDown); + void RemoveCrossEquipID(T2FloorInfo* floorInfo, int position); + void RemoveUnstoppable(T2TowerDoc* towerDoc); + void AddCrossEquipID(T2FloorInfo* floorInfo, int position); + void AddCEFloorID(T2FloorInfo* floorInfo, int position); + void ReplaceID(T2FloorInfo* floorInfo, unsigned int); + POINT PositionToStopPt(int position, ERequestUpDown upDown); + int UnitToPosition(int unit) const; + int PositionToUnit(int position) const; + BOOL IsStopPosition(int position) const; + BOOL IsStopPosition(int position, ERequestUpDown upDown); + BOOL AddModule(T2TowerDoc* towerDoc, int position); + void AddStairModule(T2TowerDoc* towerDoc, const RECT& rect, BOOL insertAtEnd); + unsigned int GetRequestID(int position, BOOL isDown) const; int GetModuleCount() const; int FindStairModule(T2TowerDoc*, POINT, T2MoverModule*&, T2MoverModule*&); int CalcModuleRect(const T2MoverModule*, RECT&, int&) const; T2MoverModule* FindPeople(const T2People*) const; void CalcMachineArea(EEquipPos, RECT&) const; void AdjustLength(); - T2Request* GetRequest(T2FloorInfo*, int, int) const; + T2Request* GetRequest(T2FloorInfo* floorInfo, int position, BOOL isDown) const; int CalcScore(int) const; - int ExpandArea(T2TowerDoc*, EEquipPos, int); - int IsHomePosition(int) const; + int ExpandArea(T2TowerDoc* towerDoc, EEquipPos pos, int count); + BOOL IsHomePosition(int) const; void CalcBodyArea(RECT&) const; int CalcModulePos(T2MoverModule*, ERequestUpDown); void ShowShaft(); void HideShaft(); - virtual unsigned int Idle(T2TowerDoc*); + + void SetShowShaft(BOOL v) { mShowShaft = v; } + void StartBuild() { mStatus = kMoverStatus0; } + BOOL IsStair() const { return IsSetAttribute(kMoverAttrIsStair); } + BOOL IsElevator() const { return IsSetAttribute(kMoverAttrIsElevator); } + BOOL IsCheckRequest() const { return mCheckRequest; } + void SetCheckRequest(BOOL v) { mCheckRequest = v; } + int GetLength() const { return mLength; } + int GetWaitCount() const { return mWaitCount; } + T2RequestIDArray* GetReqIDArray() const { return mReqIDArray; } + T2MoverModuleList* GetModuleList() const { return mModuleList; } + BOOL IsShaftVisible() const { return mShowShaft; } + protected: - virtual void LoadSelf(T2Archive&, T2TowerDoc*); - virtual void SaveSelf(T2Archive&); -public: - virtual T2InfoDialog* ShowInfoDialog(T2TowerDoc*, CPoint); + virtual void LoadSelf(T2Archive&, T2TowerDoc*); + virtual void SaveSelf(T2Archive&); + + friend class T2MoverDef; - void SetShowShaft(int) {} - void StartBuild() {} - virtual int IsBuildFinish() {} - virtual int Enter(CLink*) {} - virtual int Leave(CLink*) {} - T2Mover(const T2Mover&) {} - T2Mover& operator=(const T2Mover&) {} - int IsStair() const {} - int IsElevator() const {} - int IsCheckRequest() const {} - void SetCheckRequest(int) {} - int GetLength() const {} - int GetWaitCount() const {} - T2RequestIDArray* GetReqIDArray() const {} - T2MoverModuleList* GetModuleList() const {} - int IsShaftVisible() const {} + int mLength; + T2RequestIDArray *mReqIDArray; + int mWaitCount; + int mMaxModule; + T2MoverModuleList *mModuleList; + BOOL mShowShaft; + BOOL mCheckRequest; }; |