#pragma once #include "common.h" class AFX_EXT_CLASS T2FloorInfo { public: T2FloorInfo(const T2WorldDef* inWorldDef); virtual ~T2FloorInfo(); int UnitToFloor(int unit) const; void InitMask(CResFile& inResFile); void Read(T2Archive& inArchive, T2TowerDoc* inDoc); void Write(T2Archive& inArchive); BOOL IsAreaBuildable(const RECT& inRect); BOOL IsAllTenant(const RECT& inRect); BOOL IsThereNoFloorTenant(const RECT& inRect); BOOL IsThereMover(const RECT& inRect); BOOL IsThereOtherKindMover(const RECT& inRect, int inType); BOOL IsEnoughSideSpace(const RECT& inRect); T2Tenant* GetTenant(unsigned int inTenantID) const; T2Tenant* GetTenant(int inV, int inH) const; T2Tenant* GetPoolTenant() const; T2Tenant* GetFloor(int inV, int inH) const; T2Mover* GetMover(unsigned int inMoverID); T2Mover* GetMover(int inV, int inH); T2MoverModule* GetModule(unsigned int inModuleID) const; T2Request* GetRequest(unsigned int inRequestID) const; T2Request* GetRequest(int inV, int inH) const; T2People* FindPeople(int inV, int inH) const; T2OutObj* GetOutObj(int inV, int inH) const; T2OutObj* GetIndOutObj(unsigned int inIndex) const; T2Tenant* FindUnusedTenant(); T2Mover* FindUnusedMover(); T2Request* FindUnusedRequest(); T2OutObj* FindUnusedOutObj(); unsigned int GetTenantID(int inV, int inH) const; unsigned int GetFloorID(int inV, int inH); unsigned int GetEntranceFloorID(unsigned int inTenantID); POINT GetEntrancePt(unsigned int inTenantID); unsigned int GetMoverID(int inV, int inH); unsigned int GetRequestID(int inV, int inH) const; unsigned int GetOutObjID(int inV, int inH) const; T2UnitInfo* GetUnitInfo(int inV, int inH) const; void FillTenantID(const RECT& inRect, unsigned int inTenantID); void ReplaceFloorID(const RECT& inRect, unsigned int inOldID, unsigned int inNewID); void FillMoverID(const RECT& inRect, unsigned int inMoverID); void FillRequestID(const RECT& inRect, unsigned int inRequestID); int FillRequestID(POINT inPt, ERequestUpDown inUpDown, unsigned int inRequestID); void RemoveRequestID(ERequestUpDown inUpDown, const RECT& inRect); void FillOutObjID(const RECT& inRect, unsigned int inOutObjID); unsigned int FindTenantID(int inV, int inH, BOOL inRight, int inMaxDistance, unsigned int inExclTenantID); int GetLeftMoverID(POINT inPt, int inMinH) const; void UpdeteRequestByUnionFloor(T2Tenant* inTenant, POINT inPt); void MoverAreaAdded(const RECT& inRect, unsigned int inMoverID); void MoverAreaRemoved(const RECT& inRect); void UpdeteRequestByBuildMover(const RECT& inRect); void UpdeteRequestByRemoveMover(const RECT& inRect); unsigned int GetNextTenantNumber(int inV); void SetTenantNumber(int inV, unsigned int inTenantNumber); T2Tenant* FindNumberredTenant(int inV, unsigned int inTenantNumber); void FinishBuildFloor(T2TowerDoc* inDoc, const RECT& inRect); void SetTenantDrawModeByRect(const RECT& inRect, int inDrawMode); void UpdateFloorCEArray(const RECT& inRect, unsigned int inOldID, unsigned int inNewID); int CalcMentenanceCost(T2TowerDoc* inDoc) const; T2Tenant* GetTenantByPID(DWORD inPluginID); BOOL BuildFinishForce(const RECT& inRect); int GetVRange() const { return mVRange; } int GetHRange() const { return mHRange; } int GetGroundLine() const { return mGroundLine; } int GetTopFloorLine() const { return mTopFloorLine; } int GetBottomFloorLine() const { return mBottomFloorLine; } int GetEntranceWidth() const { return mEntranceWidth; } void GetBuildArea(RECT& outRect) const { outRect = mBuildArea; } void GetFloorArea(RECT& outRect) const { outRect = mFloorArea; } T2TenantArrayList* GetTenantArrayList() const { return mTenantArrayList; } T2MoverArrayList* GetMoverArrayList() const { return mMoverArrayList; } T2RequestArrayList* GetRequestArrayList() const { return mRequestArrayList; } T2OutObjArrayList* GetOutObjArrayList() const { return mOutObjArrayList; } T2OutsideInfo* GetOutsideInfo() const { return mOutsideInfo; } int mVRange; int mHRange; int mGroundLine; int mTopFloorLine; int mBottomFloorLine; int mEntranceWidth; RECT mBuildArea; RECT mFloorArea; T2UnitInfo *mUnitInfo; unsigned int *mTenantNumber; T2TenantArrayList *mTenantArrayList; T2MoverArrayList *mMoverArrayList; T2RequestArrayList *mRequestArrayList; T2OutObjArrayList *mOutObjArrayList; T2OutsideInfo *mOutsideInfo; protected: BOOL IsValidRange(const RECT& inRect) const; int CalcRequestRightEnd(POINT inPt, int inMaxH); int CalcRequestLeftEnd(POINT inPt, int inMinH); };