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

class AFX_CLASS_EXPORT T2FInfoAreaIterator {
public:
	T2FInfoAreaIterator(const T2FloorInfo& inFloorInfo, const RECT&);
	virtual ~T2FInfoAreaIterator();

	void Reset();
	BOOL CurrentV(int& outV) const;
	BOOL Current(T2UnitInfo*& outUnitInfo);
	BOOL Next(T2UnitInfo*& outUnitInfo);
	BOOL NextTenant(T2Tenant*& outTenant);
	void GetTenantRect(RECT& outRect);
	BOOL NextRequest(T2Request*& outRequest);
	BOOL NextMover(T2Mover*& outMover);

protected:
	BOOL CalcNextUnitInfo();
	BOOL IsValidPosition() const;

	const T2FloorInfo &mFloorInfo;
	RECT mRect;
	int mSkipAmount;
	int mCurrV;
	int mCurrH;
	T2UnitInfo *mCurrUnitInfo;
	unsigned int mLastIDSeen;
};

inline BOOL T2FInfoAreaIterator::IsValidPosition() const {
    return (mCurrH > -1);
}