#ifndef T2DLL_T2PEOPLETYPE_H #define T2DLL_T2PEOPLETYPE_H #include "../common.h" // Transport types enum { kTransportLobbyLeft = 0, kTransportLobbyRight, kTransportParking, kTransportSubway, kTransportShip }; enum { kTransportFlagLobbyLeft = 1 << kTransportLobbyLeft, kTransportFlagLobbyRight = 1 << kTransportLobbyRight, kTransportFlagParking = 1 << kTransportParking, kTransportFlagSubway = 1 << kTransportSubway, kTransportFlagShip = 1 << kTransportShip }; enum { kEconoType7 = 7, }; enum { kMaxTimeZone = 24, }; enum { kDemandType0 = 0, kDemandType1 = 1, kDemandType2 = 2, kDemandType3 = 3, // tourist? kDemandType4 = 4, kDemandType5 = 5, kDemandType6 = 6, kDemandType7 = 7, kMaxDemand = 8, }; class AFX_CLASS_EXPORT T2PeopleType { public: T2PeopleType(); ~T2PeopleType(); void SetDemandType(int); void SetTimeZoneType(int); int GetDemandType() const; int GetTimeZoneType() const; void RecoverLife(); void Duplicate(T2PeopleType&) const; BOOL Check(T2TenantMemberDef*, int inEconoType, unsigned int inRoute) const; BOOL CheckWithDemand(T2TenantMemberDef*, int econoType) const; void Read(T2Archive&); void Write(T2Archive&); void SetSilhouetteType(int v); void SetEconoType(int v); void SetTransportType(int v); void SetLifeCount(int v); int GetSilhouetteType() const; int GetTransportType() const; int GetAge() const; BOOL IsMale() const; BOOL IsImmortal() const; BOOL HasLife() const; void DecreaseLife(); int GetEconoType() const; protected: BOOL CheckDemandType(int) const; BOOL CheckSilhouetteType(T2TenantMemberDef*) const; BOOL CheckSilhouetteOptionType(int) const; unsigned int mAttribute; int mSilhouetteType; int mEconoType; int mLife; int mTransportType; friend class T2PoolView; }; inline void T2PeopleType::SetSilhouetteType(int v) { mSilhouetteType = v; } inline void T2PeopleType::SetEconoType(int v) { mEconoType = v; } inline void T2PeopleType::SetTransportType(int v) { mTransportType = v; } inline void T2PeopleType::SetLifeCount(int v) { mLife = v; } inline int T2PeopleType::GetSilhouetteType() const { return mSilhouetteType; } inline int T2PeopleType::GetTransportType() const { return mTransportType; } inline int T2PeopleType::GetAge() const { return mSilhouetteType >> 3; } inline BOOL T2PeopleType::IsMale() const { return (mSilhouetteType % 2) == 0; } inline BOOL T2PeopleType::IsImmortal() const { return (mLife == 127); } inline BOOL T2PeopleType::HasLife() const { return (mLife > 0); } inline void T2PeopleType::DecreaseLife() { if (!IsImmortal()) mLife--; } inline int T2PeopleType::GetEconoType() const { return mEconoType; } #endif