summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2FInfoAreaIterator.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-06-28 22:22:32 +0100
committerAsh Wolf <ninji@wuffs.org>2023-06-28 22:22:32 +0100
commitc0c336500955a23e344651e5412c9d9d441ef4ee (patch)
tree790769c748db307cf3314f6e896e2f61c68561a2 /src/T2DLL/T2FInfoAreaIterator.h
parent37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff)
downloadt2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz
t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip
first pass of T2DLL
Diffstat (limited to '')
-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;
};