#pragma once #include "common.h" #include "CLink.h" #include "T2Matter.h" #include "T2PeopleType.h" 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_CLASS_EXPORT T2People : public CLink, public T2Matter { public: T2People(); virtual ~T2People(); 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*); BOOL IsMale() const; BOOL IsGeneral() const; BOOL IsSpecialColor() const; void ChangeStyle(int); int GetWidth() const; int GetRouteType(); BOOL CalcWaitPersonArea(T2FloorInfo*, RECT&); void CalcWalkingSilhouetteArea(RECT&) const; unsigned int GetCurTenantID() const; void GoOutTower(T2TowerDoc*); void IdleSearchedPerson(T2TowerDoc*); void ChangeStatus(int); void ChangeWalkStyle(int); 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 tenantID, unsigned int startTime = 0); int CalcCurrEstimate() const; void IncEstimate(int); void UpdateEstimation(); int GetAverageStress() const; BOOL IncStress(int); BOOL IsVIP() const; BOOL IsNamed() const; void SetColor(int); void ClearColor(); BOOL VIPEstimation(); BOOL SearchToilet(T2TowerDoc*); void DrawSearchedPerson(T2TowerDoc*); void Draw(T2BitImage*, const RECT&); void Draw(T2TowerDoc*, T2Equip*); void DrawAt(T2TowerDoc*, T2Equip*, POINT); void Duplicate(T2TowerDoc*); void Remove(T2TowerDoc*, unsigned int); void TenantRemoved(unsigned int); void Interview(T2TowerDoc*); BOOL GetInterviewWords(T2TowerDoc*, CString&); BOOL IsMaru() const; BOOL IsReggae() const; void BreakoutEmergency(T2TowerDoc*); void ResolveLink(T2PeopleArrayList*); void GetName(CString&); void ClearSpecialFlag(unsigned int); void SetSpecialFlag(unsigned int); 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 GetSex() const; 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 DbgPeopleView; 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(); }; inline unsigned int T2People::GetAge() const { unsigned int age = 0; if (mPeopleType) age = mPeopleType->GetAge(); return age; } inline unsigned int T2People::GetSex() const { unsigned int sex = 1; if (mPeopleType) sex = !mPeopleType->IsMale(); return sex; }