#pragma once #include "common.h" class AFX_EXT_CLASS 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 { return (mCurrH > -1); } const T2FloorInfo &mFloorInfo; RECT mRect; int mSkipAmount; int mCurrV; int mCurrH; T2UnitInfo *mCurrUnitInfo; unsigned int mLastIDSeen; }; class AFX_EXT_CLASS 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 { return (mCurrH > -1); } const T2FloorInfo &mFloorInfo; int mLeftBound; int mRightBound; int mCurrH; T2UnitInfo *mCurrUnitInfo; unsigned int mLastIDSeen; };