#pragma once #include "common.h" #include "LArray.h" class AFX_EXT_CLASS T2RoutingTable : private LArray { public: T2RoutingTable(T2FloorInfo* inFloorInfo, T2FloorPtrList* inFloorPtrList, int inWhichTable); virtual ~T2RoutingTable(); void FloorAdded(); void FloorRemoved(int inFloorID); void MoverAdded(T2Mover* inMover, BOOL inFlag); void MoverRemoved(T2Mover* inMover, BOOL inFlag); void MoverModified(T2Mover* inMover, BOOL inFlag); void FullUpdate(); BOOL CheckRoute(POINT inFromPt, POINT inToPt, unsigned int inSearchScore) const; BOOL IsConnectRouteFromLobby(POINT inPt) const; BOOL GetNextRoute(POINT inFromPt, POINT& ioToPt) const; T2Tenant* SelectNearTenant(POINT inPt, unsigned int inSearchScore) const; protected: BOOL IsRelatedMover(T2Mover* inMover) const; void AddItem(T2Mover* inMover); void RemoveItem(T2Mover* inMover); T2MoverRoutingTable* GetItem(T2Mover* inMover) const; BOOL GetElem(T2Mover* inMover, int inFloor, T2RoutingTableElem& outElem) const; int GetIndex(T2Mover* inMover) const; void Update(); void ClearData(); T2Tenant* SelectNearTenant(T2Tenant* inTenant, int inH, unsigned int inSearchScore) const; unsigned int mAttributeMask; T2FloorPtrList *mFloorPtrList; T2FloorInfo *mFloorInfo; }; class AFX_EXT_CLASS T2RoutingTableElem { public: T2RoutingTableElem(); ~T2RoutingTableElem(); BOOL IsStopFloor() const; void SetTable(unsigned int inNextFloorID, int inFinalHPos); BOOL IsSetTable(unsigned int inNextFloorID, unsigned int inScore, int inTime, int inFinalHPos); BOOL HasNextRoute(unsigned int inFloorID) const; unsigned int GetNextFloorID() const { return mNextFloorID; } unsigned int GetScore() const { return mScore; } int GetTime() const { return mTime; } int GetFinalHPos() const { return mFinalHPos; } BOOL HasRoute() const { return (mNextFloorID != 0); } protected: unsigned int mNextFloorID; unsigned int mScore; int mTime; int mFinalHPos; };