summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2People.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/T2DLL/T2People.cpp')
-rw-r--r--src/T2DLL/T2People.cpp120
1 files changed, 61 insertions, 59 deletions
diff --git a/src/T2DLL/T2People.cpp b/src/T2DLL/T2People.cpp
index 38fd272..c83373a 100644
--- a/src/T2DLL/T2People.cpp
+++ b/src/T2DLL/T2People.cpp
@@ -64,7 +64,7 @@ void T2People::Initialize() {
/*virtual*/ void T2People::SetUsed(BOOL used) {
if (!used) {
if (IsFavorite()) {
- GetCurrentT2TowerDoc()->towerDoc_vf1C4(this, true);
+ GetCurrentT2TowerDoc()->RemoveFavoritePeople(this, true);
} else if (IsNamed()) {
T2NameList *nameDB = GetCurrentT2TowerDoc()->mNameDB;
T2Name *name = nameDB->Search(this, false);
@@ -185,17 +185,17 @@ unsigned int T2People::GetCurTenantID() const {
switch (mStatus) {
case kStatus1:
- if (IsStartTime(towerDoc->towerDoc_vf120()->GetRawMinutes()) && IsSetDestination()) {
- towerDoc->towerDoc_vf130()->Leave(this);
+ if (IsStartTime(towerDoc->GetNow()->GetRawMinutes()) && IsSetDestination()) {
+ towerDoc->GetPool()->Leave(this);
MoveToTowerEntrance(towerDoc);
- if (towerDoc->towerDoc_vf154())
+ if (towerDoc->IsToiletFlagOn())
SetSpecialFlag(kSpecialFlag2);
}
break;
case kStatus11:
- if (IsStartTime(towerDoc->towerDoc_vf120()->GetRawMinutes())) {
- T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C();
+ if (IsStartTime(towerDoc->GetNow()->GetRawMinutes())) {
+ T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo();
T2Tenant *theCurrTenant = theFloorInfo->GetTenant(mCurrEquipID);
if (theCurrTenant) {
if (IsSetDestination())
@@ -223,7 +223,7 @@ unsigned int T2People::GetCurTenantID() const {
what = 1;
if (!IsWalk()) {
- if (IsReachDestination(towerDoc->towerDoc_vf12C()->GetGroundLine() - 1)) {
+ if (IsReachDestination(towerDoc->GetFloorInfo()->GetGroundLine() - 1)) {
if (!IsRegistRequest(towerDoc))
ChangeStatus(kStatus3);
}
@@ -234,8 +234,8 @@ unsigned int T2People::GetCurTenantID() const {
case kStatus10:
if (!IsWalk()) {
- if (IsReachDestination(towerDoc->towerDoc_vf12C()->GetGroundLine() - 1)) {
- T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C();
+ if (IsReachDestination(towerDoc->GetFloorInfo()->GetGroundLine() - 1)) {
+ T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo();
T2Tenant *theDstTenant = theFloorInfo->GetTenant(mDstTenant);
if (theDstTenant)
theDstTenant->EnterTenant(towerDoc, this);
@@ -245,21 +245,21 @@ unsigned int T2People::GetCurTenantID() const {
case kStatus12:
if (!IsWalk()) {
- if (IsReachDestination(towerDoc->towerDoc_vf12C()->GetGroundLine() - 1))
+ if (IsReachDestination(towerDoc->GetFloorInfo()->GetGroundLine() - 1))
GoOutTower(towerDoc);
}
break;
case kStatus13:
if (!IsWalk()) {
- if (IsReachDestination(towerDoc->towerDoc_vf12C()->GetGroundLine() - 1))
+ if (IsReachDestination(towerDoc->GetFloorInfo()->GetGroundLine() - 1))
MoveByEStair(towerDoc);
}
break;
case kStatus14:
if (!IsWalk()) {
- if (IsReachDestination(towerDoc->towerDoc_vf12C()->GetGroundLine() - 1))
+ if (IsReachDestination(towerDoc->GetFloorInfo()->GetGroundLine() - 1))
ChangeStatus(kStatus15);
}
break;
@@ -269,7 +269,7 @@ unsigned int T2People::GetCurTenantID() const {
}
void T2People::IdleWaitMover(T2TowerDoc* towerDoc) {
- T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C();
+ T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo();
BOOL didChange = IncStress(5);
if (mStress >= 300) {
@@ -283,7 +283,7 @@ void T2People::IdleWaitMover(T2TowerDoc* towerDoc) {
if (didChange) {
RECT rect;
CalcWaitPersonArea(theFloorInfo, rect);
- towerDoc->GetTowerMainView()->tmv_vf128(rect, false);
+ towerDoc->GetMainView()->InvalUnitRect(rect, false);
}
}
@@ -313,7 +313,7 @@ void T2People::MoveToTowerEntrance(T2TowerDoc* towerDoc) {
}
void T2People::MoveToLobby(T2TowerDoc* towerDoc) {
- T2FloorInfo *floorInfo = towerDoc->towerDoc_vf12C();
+ T2FloorInfo *floorInfo = towerDoc->GetFloorInfo();
T2Tenant *lobby = floorInfo->GetTenant(1000);
if (lobby) {
@@ -338,7 +338,7 @@ void T2People::MoveToLobby(T2TowerDoc* towerDoc) {
BOOL T2People::MoveToParking(T2TowerDoc* towerDoc) {
BOOL ok = false;
- T2RegistedTenantDB *registedTenantDB = towerDoc->towerDoc_vf174();
+ T2RegistedTenantDB *registedTenantDB = towerDoc->GetRegistedTenantDB();
if (registedTenantDB) {
T2Tenant *parking = NULL;
if (!IsGeneral())
@@ -360,7 +360,7 @@ BOOL T2People::MoveToSubway(T2TowerDoc* towerDoc) {
BOOL ok = false;
T2TowerEvent *theEvent = towerDoc->mWorldDef->GetTowerEvent();
- T2DateTime *theCurrTime = towerDoc->towerDoc_vf120();
+ T2DateTime *theCurrTime = towerDoc->GetNow();
T2Transport *metro = theEvent->GetMetroRailway();
if (metro) {
T2Transport *available = metro->GetAvailable(theCurrTime);
@@ -377,7 +377,7 @@ BOOL T2People::MoveToShip(T2TowerDoc* towerDoc) {
BOOL ok = false;
T2TowerEvent *event = towerDoc->mWorldDef->GetTowerEvent();
- T2DateTime *now = towerDoc->towerDoc_vf120();
+ T2DateTime *now = towerDoc->GetNow();
T2Transport *cruise = event->GetCruise();
if (cruise) {
T2Transport *available = cruise->GetAvailable(now);
@@ -391,7 +391,7 @@ BOOL T2People::MoveToShip(T2TowerDoc* towerDoc) {
}
void T2People::MoveByEStair(T2TowerDoc* towerDoc) {
- T2FloorInfo *floorInfo = towerDoc->towerDoc_vf12C();
+ T2FloorInfo *floorInfo = towerDoc->GetFloorInfo();
if (floorInfo) {
T2Tenant *theCurTenant = floorInfo->GetTenant(mCurrEquipID);
@@ -413,11 +413,11 @@ void T2People::MoveByEStair(T2TowerDoc* towerDoc) {
}
if (IsWalk()) {
- T2TowerMainView *towerMainView = towerDoc->GetTowerMainView();
+ T2TowerMainView *towerMainView = towerDoc->GetMainView();
if (towerMainView) {
RECT rect;
SetRect(&rect, mCurPosition.x, mCurPosition.y, mCurPosition.x + 2, mCurPosition.y + 1);
- towerMainView->tmv_vf128(rect, false);
+ towerMainView->InvalUnitRect(rect, false);
}
}
}
@@ -433,7 +433,7 @@ void T2People::SolveNoRoute(T2TowerDoc* towerDoc) {
if (!FindRoute(towerDoc)) {
changed = IncStress(30) && IsWalk();
if (mStress >= 300) {
- T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C();
+ T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo();
if (IsWalk()) {
// "道がないよ~" - there is no way
CString theMessage = "\x93\xB9\x82\xAA\x82\xC8\x82\xA2\x82\xE6\x81\x60";
@@ -442,7 +442,7 @@ void T2People::SolveNoRoute(T2TowerDoc* towerDoc) {
RECT theRect;
CalcWalkingSilhouetteArea(theRect);
theFloorInfo->SetTenantDrawModeByRect(theRect, DrawMode1);
- towerDoc->GetTowerMainView()->tmv_vf128(theRect, false);
+ towerDoc->GetMainView()->InvalUnitRect(theRect, false);
}
T2Tenant *theFloor = theFloorInfo->GetTenant(mCurrEquipID);
@@ -455,14 +455,14 @@ void T2People::SolveNoRoute(T2TowerDoc* towerDoc) {
if (changed) {
RECT rect;
CalcWalkingSilhouetteArea(rect);
- towerDoc->GetTowerMainView()->tmv_vf128(rect, false);
+ towerDoc->GetMainView()->InvalUnitRect(rect, false);
}
}
BOOL T2People::FindRoute(T2TowerDoc* towerDoc) {
BOOL ok = false;
int status = mStatus;
- T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C();
+ T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo();
if (theFloorInfo) {
mCurrDestPos = theFloorInfo->GetEntrancePt(mDstTenant);
@@ -477,7 +477,7 @@ BOOL T2People::FindRoute(T2TowerDoc* towerDoc) {
ok = true;
} else {
int routeType = GetRouteType();
- if (towerDoc->towerDoc_vf124()->GetNextRoute(mCurPosition, mCurrDestPos, routeType)) {
+ if (towerDoc->GetRouteNavi()->GetNextRoute(mCurPosition, mCurrDestPos, routeType)) {
if (routeType >= kRouteType0)
status = kStatus5;
else
@@ -496,7 +496,7 @@ BOOL T2People::FindRoute(T2TowerDoc* towerDoc) {
ChangeStatus(status);
- T2TrafficInfo *trafficInfo = towerDoc->towerDoc_vf150();
+ T2TrafficInfo *trafficInfo = towerDoc->GetTrafficInfo();
if (trafficInfo)
trafficInfo->Pass(mCurPosition, mCurrDestPos, 1);
}
@@ -505,7 +505,7 @@ BOOL T2People::FindRoute(T2TowerDoc* towerDoc) {
}
void T2People::JumpToDestination(T2TowerDoc* towerDoc) {
- T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C();
+ T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo();
POINT theDestPos = theFloorInfo->GetEntrancePt(mDstTenant);
mCurPosition = theDestPos;
@@ -514,11 +514,11 @@ void T2People::JumpToDestination(T2TowerDoc* towerDoc) {
}
void T2People::GoOutTower(T2TowerDoc* towerDoc) {
- T2Tenant *theFloor = towerDoc->towerDoc_vf12C()->GetTenant(mCurrEquipID);
+ T2Tenant *theFloor = towerDoc->GetFloorInfo()->GetTenant(mCurrEquipID);
if (theFloor)
theFloor->Leave(this);
- T2Pool *pool = towerDoc->towerDoc_vf130();
+ T2Pool *pool = towerDoc->GetPool();
pool->Enter(this);
}
@@ -543,10 +543,10 @@ void T2People::IdleSearchedPerson(T2TowerDoc* towerDoc) {
case kStatus2:
{
- T2TowerMainView *theView = towerDoc->GetTowerMainView();
+ T2TowerMainView *theView = towerDoc->GetMainView();
RECT area;
CalcWalkingSilhouetteArea(area);
- theView->tmv_vf128(area, false);
+ theView->InvalUnitRect(area, false);
mStatus = kStatus3;
break;
}
@@ -561,7 +561,7 @@ void T2People::IdleSearchedPerson(T2TowerDoc* towerDoc) {
case kStatus10:
{
- T2FloorInfo *floorInfo = towerDoc->towerDoc_vf12C();
+ T2FloorInfo *floorInfo = towerDoc->GetFloorInfo();
T2Tenant *theDstTenant = floorInfo->GetTenant(mDstTenant);
if (theDstTenant)
theDstTenant->EnterTenant(towerDoc, this);
@@ -588,12 +588,12 @@ void T2People::IdleSearchedPerson(T2TowerDoc* towerDoc) {
BOOL T2People::WalkSearchedPersonRight(T2TowerDoc* towerDoc) {
BOOL ok = false;
T2FloorInfo *floorInfo = towerDoc->mFloorInfo;
- T2TowerMainView *theMainView = towerDoc->GetTowerMainView();
+ T2TowerMainView *theMainView = towerDoc->GetMainView();
RECT rect;
SetRect(&rect, mCurPosition.x, mCurPosition.y, mCurPosition.x + 2, mCurPosition.y + 1);
floorInfo->SetTenantDrawModeByRect(rect, DrawMode1);
- theMainView->tmv_vf128(rect, false);
+ theMainView->InvalUnitRect(rect, false);
int theWalkWidth = 2;
@@ -610,7 +610,7 @@ BOOL T2People::WalkSearchedPersonRight(T2TowerDoc* towerDoc) {
mCurPosition.x += theWalkWidth;
OffsetRect(&rect, theWalkWidth, 0);
- theMainView->tmv_vf128(rect, false);
+ theMainView->InvalUnitRect(rect, false);
if (mCurPosition.y != (floorInfo->GetGroundLine() - 1))
IncStress(theWalkWidth / 4);
@@ -620,13 +620,13 @@ BOOL T2People::WalkSearchedPersonRight(T2TowerDoc* towerDoc) {
BOOL T2People::WalkSearchedPersonLeft(T2TowerDoc* towerDoc) {
BOOL ok = false;
- T2FloorInfo *floorInfo = towerDoc->towerDoc_vf12C();
- T2TowerMainView *theMainView = towerDoc->GetTowerMainView();
+ T2FloorInfo *floorInfo = towerDoc->GetFloorInfo();
+ T2TowerMainView *theMainView = towerDoc->GetMainView();
RECT rect;
SetRect(&rect, mCurPosition.x, mCurPosition.y, mCurPosition.x + 2, mCurPosition.y + 1);
floorInfo->SetTenantDrawModeByRect(rect, DrawMode1);
- theMainView->tmv_vf128(rect, false);
+ theMainView->InvalUnitRect(rect, false);
int theWalkWidth = 2;
@@ -646,7 +646,7 @@ BOOL T2People::WalkSearchedPersonLeft(T2TowerDoc* towerDoc) {
mCurPosition.x -= theWalkWidth;
OffsetRect(&rect, -theWalkWidth, 0);
- theMainView->tmv_vf128(rect, false);
+ theMainView->InvalUnitRect(rect, false);
if (mCurPosition.y != (floorInfo->GetGroundLine() - 1))
IncStress(theWalkWidth / 4);
@@ -817,7 +817,7 @@ void T2People::SetDestinationToOutOfTower(T2TowerDoc* towerDoc) {
switch (mPeopleType->GetTransportType()) {
case kTransportParking:
{
- T2RegistedTenantDB *registedTenantDB = towerDoc->towerDoc_vf174();
+ T2RegistedTenantDB *registedTenantDB = towerDoc->GetRegistedTenantDB();
if (registedTenantDB) {
T2Tenant *parking = NULL;
if (!IsGeneral()) {
@@ -974,8 +974,8 @@ BOOL T2People::SearchToilet(T2TowerDoc* towerDoc) {
BOOL ok = false;
if (SetDestinationToReturn()) {
- T2RegistedTenantDB *theDB = towerDoc->towerDoc_vf174();
- T2RouteNavigator *theNavi = towerDoc->towerDoc_vf124();
+ T2RegistedTenantDB *theDB = towerDoc->GetRegistedTenantDB();
+ T2RouteNavigator *theNavi = towerDoc->GetRouteNavi();
if (theDB && theNavi) {
int toiletStatus;
T2Tenant *theToilet = theDB->SearchToilet(theNavi, mCurPosition, toiletStatus);
@@ -1031,7 +1031,7 @@ void T2People::DrawSearchedPerson(T2TowerDoc* towerDoc) {
}
/*virtual*/ void T2People::Draw(T2TowerDoc* towerDoc, const RECT& inRect) {
- if (towerDoc->towerDoc_vf108() > 0)
+ if (towerDoc->GetZoomLevel() > 0)
return;
if (m18 != -1) {
@@ -1042,7 +1042,8 @@ void T2People::DrawSearchedPerson(T2TowerDoc* towerDoc) {
#line 1380
_ASSERT(objectID != -1);
- mSilhouetteDef[mStyle]->mImageObj->DrawObject(towerDoc->towerDoc_vf10C(), objectID, rect, towerDoc->towerDoc_vf108(), T2PaletteAnimeDef::GetCommonColor(mColor));
+ mSilhouetteDef[mStyle]->mImageObj->DrawObject(towerDoc->GetImage(), objectID, rect,
+ towerDoc->GetZoomLevel(), T2PaletteAnimeDef::GetCommonColor(mColor));
}
}
@@ -1066,11 +1067,12 @@ void T2People::Draw(T2TowerDoc* towerDoc, T2Equip* equip) {
POINT curPosition = GetCurPosition();
SetRect(&rect, curPosition.x, curPosition.y, curPosition.x + 2, curPosition.y + 1);
- UT2Coordinate::UnitToQD(rect, towerDoc->towerDoc_vf108());
+ UT2Coordinate::UnitToQD(rect, towerDoc->GetZoomLevel());
int theInd = equip->GetEquipDef()->mImageObj->FindObject(1003, mFiller);
if (theInd >= 0)
- equip->GetEquipDef()->mImageObj->DrawObject(towerDoc->towerDoc_vf10C(), theInd, rect, towerDoc->towerDoc_vf108());
+ equip->GetEquipDef()->mImageObj->DrawObject(towerDoc->GetImage(), theInd, rect,
+ towerDoc->GetZoomLevel());
}
}
@@ -1080,11 +1082,11 @@ void T2People::DrawAt(T2TowerDoc* towerDoc, T2Equip* equip, POINT pt) {
SetRect(&rect, 0, 0, 2, 1);
rect.OffsetRect(mCurPosition.x - pt.x, mCurPosition.y - pt.y);
- UT2Coordinate::UnitToQD(rect, towerDoc->towerDoc_vf108());
+ UT2Coordinate::UnitToQD(rect, towerDoc->GetZoomLevel());
int theInd = equip->GetEquipDef()->mImageObj->FindObject(1003, mFiller);
if (theInd >= 0)
- equip->GetEquipDef()->mImageObj->DrawObject(towerDoc->towerDoc_vf10C(), theInd, rect);
+ equip->GetEquipDef()->mImageObj->DrawObject(towerDoc->GetImage(), theInd, rect);
}
}
@@ -1110,7 +1112,7 @@ void T2People::Remove(T2TowerDoc* inTowerDoc, unsigned int id) {
}
if (flag && IsGeneral() && GetStatus() == kStatus1) {
- T2Pool *pool = inTowerDoc->towerDoc_vf130();
+ T2Pool *pool = inTowerDoc->GetPool();
if (pool)
pool->RemovePeople(this);
}
@@ -1126,7 +1128,7 @@ void T2People::TenantRemoved(unsigned int id) {
}
void T2People::Interview(T2TowerDoc* towerDoc) {
- T2FloorInfo *floorInfo = towerDoc->towerDoc_vf12C();
+ T2FloorInfo *floorInfo = towerDoc->GetFloorInfo();
if (floorInfo) {
CString text;
if (GetInterviewWords(towerDoc, text) && text.GetLength() != 0) {
@@ -1155,13 +1157,13 @@ BOOL T2People::GetInterviewWords(T2TowerDoc* towerDoc, CString& outStr) {
optionEvent.people = this;
optionEvent.str = &outStr;
- if (!DispatchOptionEvent(OptionEventType_11, &optionEvent))
+ if (!DispatchOptionEvent(kPreInterviewWordsOptionEvent, &optionEvent))
return outStr != "";
unsigned int theFlags = 0;
T2PeopleDef *thePeopleDef = (T2PeopleDef *) GetMatterDef();
- T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C();
+ T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo();
T2Tenant *theDstTenant = theFloorInfo->GetTenant(mDstTenant);
T2Tenant *theWorkTenant = theFloorInfo->GetTenant(GetWorkTenant());
@@ -1189,7 +1191,7 @@ BOOL T2People::GetInterviewWords(T2TowerDoc* towerDoc, CString& outStr) {
if (mDstTenant == 1 && VIPEstimation())
theFlags |= 0x10;
- switch (towerDoc->towerDoc_vf138()) {
+ switch (towerDoc->GetLevel()) {
case 1:
level = 3;
break;
@@ -1214,7 +1216,7 @@ BOOL T2People::GetInterviewWords(T2TowerDoc* towerDoc, CString& outStr) {
T2WordDefArray *theWordDefArray = NULL;
if (level != 0) {
- theWordDefArray = towerDoc->towerDoc_vf170()->mWordDefArray;
+ theWordDefArray = towerDoc->GetWorldDef()->mWordDefArray;
} else {
if (mStatus == kStatus6 && thePeopleDef && mStress >= thePeopleDef->GetStressYellowLimit()) {
T2Request *request = theFloorInfo->GetRequest(mCurrEquipID);
@@ -1235,7 +1237,7 @@ BOOL T2People::GetInterviewWords(T2TowerDoc* towerDoc, CString& outStr) {
optionEvent.people = this;
optionEvent.str = &outStr;
- DispatchOptionEvent(OptionEventType_12, &optionEvent);
+ DispatchOptionEvent(kPostInterviewWordsOptionEvent, &optionEvent);
return outStr != "";
}
@@ -1263,7 +1265,7 @@ void T2People::BreakoutEmergency(T2TowerDoc* towerDoc) {
break;
case kStatus1:
if (IsGeneral())
- towerDoc->towerDoc_vf130()->RemovePeople(this);
+ towerDoc->GetPool()->RemovePeople(this);
break;
}
}
@@ -1480,8 +1482,8 @@ void T2People::GetName(CString& outStr) {
if (IsWalk()) {
CRect rect;
if (GetSilhouetteRect(rect)) {
- UT2Coordinate::UnitToQD(rect, towerDoc->towerDoc_vf108());
- towerDoc->towerDoc_vf10C()->FillRect(rect, 1);
+ UT2Coordinate::UnitToQD(rect, towerDoc->GetZoomLevel());
+ towerDoc->GetImage()->FillRect(rect, 1);
}
}
}