summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2RoutingTable.h
blob: f2c3691b21b3463dfca074457076322e756a9cc8 (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
#pragma once
#include "common.h"
#include "LArray.h"

class AFX_CLASS_EXPORT 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;
};