diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-07-01 02:43:29 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-07-01 02:43:29 +0100 |
commit | 5c6a48b2ff362a70416a6a00fda7d06e0f276f2d (patch) | |
tree | 62cf542c68d91aa6f7a4e3bfa9eddca4ab352970 /src/T2DLL/T2Tenant.h | |
parent | c0c336500955a23e344651e5412c9d9d441ef4ee (diff) | |
download | t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.tar.gz t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.zip |
i am in hell
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2Tenant.h | 237 |
1 files changed, 154 insertions, 83 deletions
diff --git a/src/T2DLL/T2Tenant.h b/src/T2DLL/T2Tenant.h index 73dd7f5..381424e 100644 --- a/src/T2DLL/T2Tenant.h +++ b/src/T2DLL/T2Tenant.h @@ -37,7 +37,7 @@ enum { kTenantRegistID10 = 10, // ticket booth }; -class T2Tenant : public T2Equip { +class AFX_CLASS_EXPORT T2Tenant : public T2Equip { public: T2Tenant(); virtual ~T2Tenant(); @@ -47,9 +47,44 @@ public: virtual unsigned int Idle(T2TowerDoc* inDoc); virtual void Draw(T2TowerDoc* inDoc, const RECT&); virtual void BuildStart(T2TowerDoc* inDoc); + + unsigned int GetResideDay() const { return mResideDay; } + int GetEstimate() const { return mEstimate; } + void SetRelatedTenantID(unsigned int inID) { mRelatedTenantID = inID; } + unsigned int GetRelatedTenantID() const { return mRelatedTenantID; } + BOOL IsSetRelatedTenantID() const { return (mRelatedTenantID != 0); } + BOOL IsFloor() const { return IsSetAttribute(kTenantAttrIsFloor); } + BOOL IsPoolTenant() const { return (mEquipID == 1000); } + BOOL IsHome() const { return IsSetAttribute(kTenantAttrIsHome); } + BOOL IsConcat() const { return IsSetAttribute(kTenantAttrIsConcat); } + BOOL IsPeopleAnime() const { return IsSetAttribute(kTenantAttrIsPeopleAnime | kTenantAttrIsPeopleAnime2); } + BOOL IsNeedToilet() const { return IsSetAttribute(kTenantAttrIsNeedToilet); } + BOOL IsNeedDraw() { return mToolDef && mDrawMode; } + BOOL IsTherePeople() const { return mFirstPeople != NULL; } + BOOL IsThereCustomer() const { return mCustomerCount > 0; } + T2People* GetFirstPeople() const { return mFirstPeople; } + BOOL IsOpen() const { return mStatus >= kTenantStatus30 && mStatus <= kTenantStatus9999; } + BOOL WillBeFull() const { return (mCustomerCount + mReserveCount) >= GetCapacity(); } + int CalcRestCapacity() const { return GetCapacity() - (mCustomerCount + mReserveCount); } + void SetMark(int inMark) { mMark = inMark; } + int GetMark() const { return mMark; } + int GetBelongCount() const { return mBelongCount; } + void ClearWorkCount() { mWorkCount = 0; } + int GetTotalCustomer() const { return mTotalCustomer; } + void ClearTotalCustomer() { mTotalCustomer = 0; } + void IncTotalCustomer() { mTotalCustomer++; } + T2PeoplePtrList* GetBelongList() const { return mBelongList; } + void SetRelatedTenantList(T2EquipPtrList* inList) { mRelatedTenantList = inList; } + T2EquipPtrList* GetRelatedTenantList() const { return mRelatedTenantList; } virtual BOOL IsBuildFinish() { return mStatus > kTenantStatus9; } + + BOOL IsFire() { return mStatus >= kTenantStatus10000; } + BOOL IsFireproof() const { return IsSetAttribute(kTenantAttrIsFireproof); } + unsigned int GetTenantNumber() const { return mTenantNumber; } + void SetTenantNumber(unsigned int inNumber) { mTenantNumber = inNumber; } + virtual PROCCODE DoDestruct(T2TowerDoc* inDoc, POINT inPt, RECT& outRect); - virtual void ClearDrawMode() { mDrawMode = DrawMode0; } + virtual void ClearDrawMode(); virtual void PlaySound(T2TowerDoc* inDoc, int inID, unsigned int inMask, unsigned int inFlags) const; virtual void AddCEMoverID(const T2FloorInfo* inFloorInfo, POINT inPt, unsigned int inID); virtual unsigned int GetEntranceFloorID(); @@ -131,86 +166,25 @@ public: void SetMerchandise(int inCount, int* inArray); void SetRelatedTenant(T2TowerDoc* inDoc, unsigned int inRegistID); - unsigned int GetResideDay() const { return mResideDay; } - int GetEstimate() const { return mEstimate; } - void SetRelatedTenantID(unsigned int inID) { mRelatedTenantID = inID; } - unsigned int GetRelatedTenantID() const { return mRelatedTenantID; } - BOOL IsSetRelatedTenantID() const { return (mRelatedTenantID != 0); } - BOOL IsFloor() const { return IsSetAttribute(kTenantAttrIsFloor); } - BOOL IsPoolTenant() const { return (mEquipID == 1000); } - BOOL IsHome() const { return IsSetAttribute(kTenantAttrIsHome); } - BOOL IsConcat() const { return IsSetAttribute(kTenantAttrIsConcat); } - BOOL IsPeopleAnime() const { return IsSetAttribute(kTenantAttrIsPeopleAnime | kTenantAttrIsPeopleAnime2); } - BOOL IsNeedToilet() const { return IsSetAttribute(kTenantAttrIsNeedToilet); } - BOOL IsNeedDraw() { return mToolDef && mDrawMode; } - BOOL IsTherePeople() const { return mFirstPeople != NULL; } - BOOL IsThereCustomer() const { return mCustomerCount > 0; } - T2People* GetFirstPeople() const { return mFirstPeople; } - BOOL IsOpen() const { return mStatus >= kTenantStatus30 && mStatus <= kTenantStatus9999; } - BOOL WillBeFull() const { return (mCustomerCount + mReserveCount) >= GetCapacity(); } - int CalcRestCapacity() const { return GetCapacity() - (mCustomerCount + mReserveCount); } - void SetMark(int inMark) { mMark = inMark; } - int GetMark() const { return mMark; } - int GetBelongCount() const { return mBelongCount; } - void ClearWorkCount() { mWorkCount = 0; } - int GetTotalCustomer() const { return mTotalCustomer; } - void ClearTotalCustomer() { mTotalCustomer = 0; } - void IncTotalCustomer() { mTotalCustomer++; } - T2PeoplePtrList* GetBelongList() const { return mBelongList; } - void SetRelatedTenantList(T2EquipPtrList* inList) { mRelatedTenantList = inList; } - T2EquipPtrList* GetRelatedTenantList() const { return mRelatedTenantList; } - BOOL IsFire() { return mStatus >= kTenantStatus10000; } - BOOL IsFireproof() const { return IsSetAttribute(kTenantAttrIsFireproof); } - unsigned int GetTenantNumber() const { return mTenantNumber; } - void SetTenantNumber(unsigned int inNumber) { mTenantNumber = inNumber; } - BOOL IsBind() const { return mIsBind; } - void Bind() { mIsBind = true; } - void Unbind() { mIsBind = false; } - unsigned int GetOpenTime() const { - unsigned int time = 0; - T2TenantDef *def = (T2TenantDef *) mToolDef; - if (def) - time = def->mOpenTime; - return time; - } - unsigned int GetCloseTime() const { - unsigned int time = 0; - T2TenantDef *def = (T2TenantDef *) mToolDef; - if (def) - time = def->mCloseTime; - return time; - } - int GetBindTime() const { - int time = 0; - T2TenantDef *def = (T2TenantDef *) mToolDef; - if (def) - time = def->mBindTime; - return time; - } - T2TenantMemberTableDef* GetEmployeeTableDef() const { - T2TenantMemberTableDef *theDef = NULL; - if (mToolDef) - theDef = ((T2TenantDef *) mToolDef)->mEmployeeTableDef; - return theDef; - } - BOOL IsFull() const { return mCustomerCount > GetCapacity(); } - int GetCustomerCount() const { return mCustomerCount; } - int GetKindIndex() const { return mKindIndex; } - void SetKindIndex(int inIndex) { mKindIndex = inIndex; } - void IncWorkCount() { mWorkCount++; } - void DecWorkCount() { mWorkCount--; } - int GetWorkCount() const { return mWorkCount; } - void ClearReserveCount() { mReserveCount = 0; } - void IncReserveCount(unsigned int inAmount) { mReserveCount += inAmount; } - void DecReserveCount() { - if (mReserveCount > 0) - mReserveCount--; - } - int GetReserveCount() const { return mReserveCount; } - void CancelReserve() { - if (mReserveCount > 0) - mReserveCount--; - } + BOOL IsBind() const; + void Bind(); + void Unbind(); + unsigned int GetOpenTime() const; + unsigned int GetCloseTime() const; + int GetBindTime() const; + T2TenantMemberTableDef* GetEmployeeTableDef() const; + BOOL IsFull() const; + int GetCustomerCount() const; + int GetKindIndex() const; + void SetKindIndex(int inIndex); + void IncWorkCount(); + void DecWorkCount(); + int GetWorkCount() const; + void ClearReserveCount(); + void IncReserveCount(unsigned int inAmount); + void DecReserveCount(); + int GetReserveCount() const; + void CancelReserve(); protected: virtual void LoadSelf(T2Archive& inArchive, T2TowerDoc* inDoc); @@ -231,7 +205,7 @@ protected: static void DrawColorMesh(T2TowerDoc* inDoc, const CRect& inRect, int inClr); BOOL CollectEmployeeFromPool(T2TowerDoc* inDoc, T2TenantMemberTableDef* inTable); unsigned int CheckRouteFromPool(T2TowerDoc* inDoc, unsigned int inScore) const; - int GetConsumptionPower() const { return 0; } + int GetConsumptionPower() const { return 0; } friend class T2EquipDef; friend class T2TenantArray; @@ -256,3 +230,100 @@ protected: T2EquipPtrList *mRelatedTenantList; unsigned int mTenantNumber; }; + +inline /*virtual*/ void T2Tenant::ClearDrawMode() { + mDrawMode = DrawMode0; +} + +inline BOOL T2Tenant::IsBind() const { + return mIsBind; +} + +inline void T2Tenant::Bind() { + mIsBind = true; +} + +inline void T2Tenant::Unbind() { + mIsBind = false; +} + +inline unsigned int T2Tenant::GetOpenTime() const { + unsigned int time = 0; + T2TenantDef *def = (T2TenantDef *) mToolDef; + if (def) + time = def->mOpenTime; + return time; +} + +inline unsigned int T2Tenant::GetCloseTime() const { + unsigned int time = 0; + T2TenantDef *def = (T2TenantDef *) mToolDef; + if (def) + time = def->mCloseTime; + return time; +} + +inline int T2Tenant::GetBindTime() const { + int time = 0; + T2TenantDef *def = (T2TenantDef *) mToolDef; + if (def) + time = def->mBindTime; + return time; +} + +inline T2TenantMemberTableDef* T2Tenant::GetEmployeeTableDef() const { + T2TenantMemberTableDef *theDef = NULL; + if (mToolDef) + theDef = ((T2TenantDef *) mToolDef)->mEmployeeTableDef; + return theDef; +} + +inline BOOL T2Tenant::IsFull() const { + return mCustomerCount >= GetCapacity(); +} + +inline int T2Tenant::GetCustomerCount() const { + return mCustomerCount; +} + +inline int T2Tenant::GetKindIndex() const { + return mKindIndex; +} + +inline void T2Tenant::SetKindIndex(int inIndex) { + mKindIndex = inIndex; +} + +inline void T2Tenant::IncWorkCount() { + mWorkCount++; +} + +inline void T2Tenant::DecWorkCount() { + mWorkCount--; +} + +inline int T2Tenant::GetWorkCount() const { + return mWorkCount; +} + +inline void T2Tenant::ClearReserveCount() { + mReserveCount = 0; +} + +inline void T2Tenant::IncReserveCount(unsigned int inAmount) { + mReserveCount += inAmount; +} + +inline void T2Tenant::DecReserveCount() { + if (mReserveCount > 0) + mReserveCount--; +} + +inline int T2Tenant::GetReserveCount() const { + return mReserveCount; +} + +inline void T2Tenant::CancelReserve() { + if (mReserveCount > 0) + mReserveCount--; +} |