summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2FInfoAreaIterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/T2DLL/T2FInfoAreaIterator.h')
-rw-r--r--src/T2DLL/T2FInfoAreaIterator.h74
1 files changed, 45 insertions, 29 deletions
diff --git a/src/T2DLL/T2FInfoAreaIterator.h b/src/T2DLL/T2FInfoAreaIterator.h
index 59ab38e..fcd389a 100644
--- a/src/T2DLL/T2FInfoAreaIterator.h
+++ b/src/T2DLL/T2FInfoAreaIterator.h
@@ -1,42 +1,58 @@
#pragma once
#include "common.h"
-class T2FInfoAreaIterator {
+class AFX_EXT_CLASS T2FInfoAreaIterator {
public:
- T2FInfoAreaIterator(const T2FloorInfo&, const RECT&);
+ 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:
- int CalcNextUnitInfo();
-public:
- int CurrentV(int&) const;
- int Current(T2UnitInfo*&);
- int Next(T2UnitInfo*&);
- int NextTenant(T2Tenant*&);
- void GetTenantRect(RECT&);
- int NextRequest(T2Request*&);
- int NextMover(T2Mover*&);
-
- T2FInfoAreaIterator(const T2FInfoAreaIterator&) {}
-protected:
- int IsValidPosition() const {}
+ BOOL CalcNextUnitInfo();
+ BOOL IsValidPosition() const {
+ return (mCurrH > -1);
+ }
+
+ const T2FloorInfo &mFloorInfo;
+ RECT mRect;
+ int mSkipAmount;
+ int mCurrV;
+ int mCurrH;
+ T2UnitInfo *mCurrUnitInfo;
+ unsigned int mLastIDSeen;
};
-class T2FInfoPtIterator {
+
+class AFX_EXT_CLASS T2FInfoPtIterator {
public:
- T2FInfoPtIterator(const T2FloorInfo&, POINT);
+ T2FInfoPtIterator(const T2FloorInfo& inFloorInfo, POINT inPt);
virtual ~T2FInfoPtIterator();
- int CurrentH(int&) const;
-protected:
- int CalcRightUnitInfo();
- int CalcLeftUnitInfo();
-public:
- int Current(T2UnitInfo*&);
- int Right(T2UnitInfo*&);
- int Left(T2UnitInfo*&);
- int RightTenant(T2Tenant*&);
- int LeftTenant(T2Tenant*&);
- T2FInfoPtIterator(const T2FInfoPtIterator&) {}
+ BOOL CurrentH(int& outH) const;
+ BOOL Current(T2UnitInfo*& outUnitInfo);
+ BOOL Right(T2UnitInfo*& outUnitInfo);
+ BOOL Left(T2UnitInfo*& outUnitInfo);
+ BOOL RightTenant(T2Tenant*& outTenant);
+ BOOL LeftTenant(T2Tenant*& outTenant);
+
protected:
- int IsValidPosition() const {}
+ BOOL CalcRightUnitInfo();
+ BOOL CalcLeftUnitInfo();
+ BOOL IsValidPosition() const {
+ return (mCurrH > -1);
+ }
+
+ const T2FloorInfo &mFloorInfo;
+ int mLeftBound;
+ int mRightBound;
+ int mCurrH;
+ T2UnitInfo *mCurrUnitInfo;
+ unsigned int mLastIDSeen;
};