diff options
Diffstat (limited to 'src/T2DLL/T2People.h')
-rw-r--r-- | src/T2DLL/T2People.h | 216 |
1 files changed, 133 insertions, 83 deletions
diff --git a/src/T2DLL/T2People.h b/src/T2DLL/T2People.h index f02058b..d1c99ec 100644 --- a/src/T2DLL/T2People.h +++ b/src/T2DLL/T2People.h @@ -1,78 +1,72 @@ #pragma once #include "common.h" +#include "CLink.h" +#include "T2Matter.h" +#include "T2PeopleType.h" -class T2People { +enum { + kSpecialFlag1 = 1, + kSpecialFlag2 = 2, // needs to use the toilet + kSpecialFlag4 = 4, + kSpecialFlag8 = 8, + kSpecialFlag10 = 0x10, + kSpecialFlag20 = 0x20, + kSpecialFlag40 = 0x40, + kSpecialFlag80 = 0x80, +}; + +enum { + kPeopleStyle0 = 0, + kPeopleStyle1 = 1, + kPeopleStyle2 = 2, + kMaxPeopleStyle = 2 +}; + +class AFX_EXT_CLASS T2People : public CLink, public T2Matter { public: T2People(); -private: - void Initialize(); -public: virtual ~T2People(); - virtual void SetUsed(int); + virtual void SetUsed(BOOL); + virtual unsigned int Idle(T2TowerDoc*); + virtual void SetFavorite(BOOL); + virtual void Draw(T2TowerDoc*, const RECT&); + virtual T2InfoDialog* ShowInfoDialog(T2TowerDoc*); + virtual void DrawHitMask(T2TowerDoc*); + virtual BOOL GetSilhouetteRect(RECT&); + void Initialize(T2PeopleDef*, T2PeopleType*); - int IsMale() const; - int IsGeneral() const; - int IsSpecialColor() const; + BOOL IsMale() const; + BOOL IsGeneral() const; + BOOL IsSpecialColor() const; void ChangeStyle(int); int GetWidth() const; int GetRouteType(); - int CalcWaitPersonArea(T2FloorInfo*, RECT&); + BOOL CalcWaitPersonArea(T2FloorInfo*, RECT&); void CalcWalkingSilhouetteArea(RECT&) const; unsigned int GetCurTenantID() const; - virtual unsigned int Idle(T2TowerDoc*); -protected: - void IdleWaitMover(T2TowerDoc*); - void MoveToTowerEntrance(T2TowerDoc*); - void MoveToLobby(T2TowerDoc*); - int MoveToParking(T2TowerDoc*); - int MoveToSubway(T2TowerDoc*); - int MoveToShip(T2TowerDoc*); - void MoveByEStair(T2TowerDoc*); - void SolveNoRoute(T2TowerDoc*); - int FindRoute(T2TowerDoc*); - void JumpToDestination(T2TowerDoc*); -public: void GoOutTower(T2TowerDoc*); void IdleSearchedPerson(T2TowerDoc*); -protected: - int WalkSearchedPersonRight(T2TowerDoc*); - int WalkSearchedPersonLeft(T2TowerDoc*); - int IsReachDestination(int); - int IsRegistRequest(T2TowerDoc*); -public: void ChangeStatus(int); -protected: - void ChangeSilhouette(); - void SetSilhouette(); -public: void ChangeWalkStyle(int); - void SetAnimePattern(int, int, int, int); - int StopOnHisWay(T2TenantMemberDef*, int, int, RECT, int, int, int, int); - int CalledInTenant(T2TenantMemberDef*, int, int, int, unsigned int, unsigned int); -protected: - int CalcFreeTime(unsigned int); -public: - int IsGoToPool() const; + void SetAnimePattern(int fillerStart, int fillerRange, int hStart, int hRange); + BOOL StopOnHisWay(T2TenantMemberDef* tenantMemberDef, int econoType, int score, RECT rect, int bindTime, int tenantType, int tenantID, int startTime); + BOOL CalledInTenant(T2TenantMemberDef* tenantMemberDef, int econoType, int bindTime, int tenantType, unsigned int tenantID, unsigned int startTime); + BOOL IsGoToPool() const; void Return(); void SetDestinationToOutOfTower(T2TowerDoc*); - void ChangeDestination(unsigned int, unsigned int); + void ChangeDestination(unsigned int tenantID, unsigned int startTime = 0); int CalcCurrEstimate() const; void IncEstimate(int); void UpdateEstimation(); int GetAverageStress() const; - int IncStress(int); -protected: - int StressChanged(); -public: - int IsVIP() const; - int IsNamed() const; + BOOL IncStress(int); + BOOL IsVIP() const; + BOOL IsNamed() const; void SetColor(int); void ClearColor(); - virtual void SetFavorite(int); - int VIPEstimation(); - int SearchToilet(T2TowerDoc*); + BOOL VIPEstimation(); + BOOL SearchToilet(T2TowerDoc*); void DrawSearchedPerson(T2TowerDoc*); - virtual void Draw(T2TowerDoc*, const RECT&); void Draw(T2BitImage*, const RECT&); void Draw(T2TowerDoc*, T2Equip*); void DrawAt(T2TowerDoc*, T2Equip*, POINT); @@ -80,43 +74,99 @@ public: void Remove(T2TowerDoc*, unsigned int); void TenantRemoved(unsigned int); void Interview(T2TowerDoc*); - int GetInterviewWords(T2TowerDoc*, CString&); - int IsMaru() const; - int IsReggae() const; + BOOL GetInterviewWords(T2TowerDoc*, CString&); + BOOL IsMaru() const; + BOOL IsReggae() const; void BreakoutEmergency(T2TowerDoc*); -protected: - virtual void LoadSelf(T2Archive&, T2TowerDoc*); - virtual void SaveSelf(T2Archive&); -public: void ResolveLink(T2PeopleArrayList*); - virtual T2InfoDialog* ShowInfoDialog(T2TowerDoc*); void GetName(CString&); - virtual int GetSilhouetteRect(RECT&); - virtual void DrawHitMask(T2TowerDoc*); void ClearSpecialFlag(unsigned int); void SetSpecialFlag(unsigned int); - unsigned int GetPeopleID() { return 0; } - T2PeopleType* GetPeopleType() const { return 0; } - unsigned int GetEconoType() { return 0; } - int IsFatSilhouette() const { return 0; } - int IsInTower() const { return 0; } - int GetColor() const { return 0; } - int IsSetSpecialFlag(unsigned int) const { return 0; } - void SetToSleep() {} - int IsSleep() const { return 0; } - int IsWalk() const { return 0; } - void SetWalk(int) {} - void SetFiller(int) {} - void SetStyle(int) {} - int GetStyle() const { return 0; } - void SetSilhouetteDef(int, T2SilhouetteDef*) {} - void SetPeopleType(T2PeopleType*) {} - void SetPrevTenantType(int) {} - int GetPrevTenantType() const { return 0; } - void InitStress() {} - int GetStress() const { return 0; } - int GetEstimate() const { return 0; } - unsigned int GetAge() const { return 0; } - unsigned int GetSex() const { return 0; } + unsigned int GetPeopleID() { return GetMatterID(); } + T2PeopleType* GetPeopleType() const { return mPeopleType; } + unsigned int GetEconoType() { return mPeopleType->GetEconoType(); } + BOOL IsFatSilhouette() const { return (mAttribute & 2) != 0; } + BOOL IsInTower() const { + return (mStatus != kStatus1) && (mStatus != kStatus16) && (mStatus != kStatus0); + } + int GetColor() const { return mColor; } + BOOL IsSetSpecialFlag(unsigned int flag) const { return (mSpecialFlag & flag) == flag; } + void SetToSleep() { mFiller = -1; } + BOOL IsSleep() const { return (mFiller == -1); } + BOOL IsWalk() const { return mWalk || IsSetSpecialFlag(kSpecialFlag20); } + void SetWalk(BOOL v) { mWalk = v; } + void SetFiller(int v) { mFiller = v; } + void SetStyle(int v) { mStyle = v; } + int GetStyle() const { return mStyle; } + void SetSilhouetteDef(int i, T2SilhouetteDef* def) { mSilhouetteDef[i] = def; } + void SetPeopleType(T2PeopleType* type) { *mPeopleType = *type; } + void SetPrevTenantType(int v) { mPrevTenantType = v; } + int GetPrevTenantType() const { return mPrevTenantType; } + void InitStress() { mStress = 0; } + int GetStress() const { return mStress; } + int GetEstimate() const { return mEstimate; } + unsigned int GetAge() const { + unsigned int age = 0; + if (mPeopleType) + age = mPeopleType->GetAge(); + return age; + } + unsigned int GetSex() const { + unsigned int sex = 1; + if (mPeopleType) + sex = !mPeopleType->IsMale(); + return sex; + } + +protected: + virtual void LoadSelf(T2Archive&, T2TowerDoc*); + virtual void SaveSelf(T2Archive&); + + void IdleWaitMover(T2TowerDoc*); + void MoveToTowerEntrance(T2TowerDoc*); + void MoveToLobby(T2TowerDoc*); + BOOL MoveToParking(T2TowerDoc*); + BOOL MoveToSubway(T2TowerDoc*); + BOOL MoveToShip(T2TowerDoc*); + void MoveByEStair(T2TowerDoc*); + void SolveNoRoute(T2TowerDoc*); + BOOL FindRoute(T2TowerDoc*); + void JumpToDestination(T2TowerDoc*); + BOOL WalkSearchedPersonRight(T2TowerDoc*); + BOOL WalkSearchedPersonLeft(T2TowerDoc*); + BOOL IsReachDestination(int y); + BOOL IsRegistRequest(T2TowerDoc*); + void ChangeSilhouette(); + void SetSilhouette(); + int CalcFreeTime(unsigned int); + BOOL StressChanged(); + + friend class T2ElevatorModule; + friend class T2FireBurning; + friend class T2Guardman; + friend class T2Maru_Reggae; + friend class T2MoverModule; + friend class T2PeopleArray; + friend class T2SilhouettePane; + friend class T2StairModule; + friend class T2Tenant; + friend class T2VisitVIP; + + unsigned int mAttribute; + int mColor; + int mFiller; + int mPrevTenantType; + int m70; + BOOL mWalk; + unsigned int mSpecialFlag; + int mStress; + int m80; + int mEstimate; + T2PeopleType *mPeopleType; + int mStyle; + T2SilhouetteDef *mSilhouetteDef[3]; + +private: + void Initialize(); }; |