From 5c6a48b2ff362a70416a6a00fda7d06e0f276f2d Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Sat, 1 Jul 2023 02:43:29 +0100 Subject: i am in hell --- src/T2DLL/T2FInfoPtIterator.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/T2DLL/T2FInfoPtIterator.h (limited to 'src/T2DLL/T2FInfoPtIterator.h') 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); +} -- cgit v1.2.3