summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2FInfoPtIterator.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
committerAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
commit5c6a48b2ff362a70416a6a00fda7d06e0f276f2d (patch)
tree62cf542c68d91aa6f7a4e3bfa9eddca4ab352970 /src/T2DLL/T2FInfoPtIterator.h
parentc0c336500955a23e344651e5412c9d9d441ef4ee (diff)
downloadt2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.tar.gz
t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.zip
i am in hell
Diffstat (limited to 'src/T2DLL/T2FInfoPtIterator.h')
-rw-r--r--src/T2DLL/T2FInfoPtIterator.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/T2DLL/T2FInfoPtIterator.h b/src/T2DLL/T2FInfoPtIterator.h
new file mode 100644
index 0000000..95c0660
--- /dev/null
+++ b/src/T2DLL/T2FInfoPtIterator.h
@@ -0,0 +1,31 @@
+#pragma once
+#include "common.h"
+
+class AFX_CLASS_EXPORT T2FInfoPtIterator {
+public:
+ T2FInfoPtIterator(const T2FloorInfo& inFloorInfo, POINT inPt);
+ virtual ~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:
+ BOOL CalcRightUnitInfo();
+ BOOL CalcLeftUnitInfo();
+ BOOL IsValidPosition() const;
+
+ const T2FloorInfo &mFloorInfo;
+ int mLeftBound;
+ int mRightBound;
+ int mCurrH;
+ T2UnitInfo *mCurrUnitInfo;
+ unsigned int mLastIDSeen;
+};
+
+inline BOOL T2FInfoPtIterator::IsValidPosition() const {
+ return (mCurrH > -1);
+}