summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2Tenant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/T2DLL/T2Tenant.cpp')
-rw-r--r--src/T2DLL/T2Tenant.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/src/T2DLL/T2Tenant.cpp b/src/T2DLL/T2Tenant.cpp
index cec110b..0a29db6 100644
--- a/src/T2DLL/T2Tenant.cpp
+++ b/src/T2DLL/T2Tenant.cpp
@@ -108,13 +108,13 @@ void T2Tenant::SetFloorID(T2FloorInfo* inFloorInfo) {
if (theFloorInfo) {
if (IsFloor()) {
- inDoc->towerDoc_vf124()->FloorRemoved(this, false);
+ inDoc->GetRouteNavi()->FloorRemoved(this, false);
theFloorInfo->FillTenantID(outRect, 0);
outRect.left -= theFloorInfo->GetEntranceWidth();
outRect.right += theFloorInfo->GetEntranceWidth();
} else {
RemovePeople(inDoc);
- inDoc->towerDoc_vf268(this);
+ inDoc->TenantRemoved(this);
RECT rect = outRect;
rect.top = rect.bottom - 1;
@@ -281,21 +281,21 @@ void T2Tenant::LeaveTenant(T2TowerDoc* inDoc, T2People* inPeople) {
}
/*virtual*/ void T2Tenant::Draw(T2TowerDoc* inDoc, const RECT& inRect) {
- if (inDoc->mViewMode != ViewMode_1 && IsFire() && !IsFloor()) {
- inDoc->towerDoc_vf170()->DrawRubble(inDoc, this);
+ if (inDoc->mViewMode != kOutView && IsFire() && !IsFloor()) {
+ inDoc->GetWorldDef()->DrawRubble(inDoc, this);
} else {
GetEquipDef()->DrawProc(this, inRect, inDoc);
if (true)
GetEquipDef()->DrawPeople(inDoc, this);
- if (mMark > -1 && inDoc->towerDoc_vf140() != ViewMode_1) {
+ if (mMark > -1 && inDoc->GetViewMode() != kOutView) {
T2WorldDef *theWorldDef = inDoc->mWorldDef;
if (theWorldDef) {
RECT equipArea, qdRect;
GetEquipArea(equipArea);
UT2Coordinate::UnitToQD(equipArea, qdRect, inDoc->mZoomLevel);
- theWorldDef->DrawMark(inDoc->towerDoc_vf10C(), qdRect, inDoc->towerDoc_vf108(), mMark);
+ theWorldDef->DrawMark(inDoc->GetImage(), qdRect, inDoc->GetZoomLevel(), mMark);
}
}
}
@@ -304,10 +304,10 @@ void T2Tenant::LeaveTenant(T2TowerDoc* inDoc, T2People* inPeople) {
if (theWorldDef->IsBlackOut()) {
CRect rect = mArea;
DrawColorMesh(inDoc, rect, 1);
- } else if (inDoc->towerDoc_vf140() == ViewMode_5) {
+ } else if (inDoc->GetViewMode() == kTransView) {
CRect rect = inRect;
DrawTrafficColor(inDoc, rect);
- } else if (inDoc->towerDoc_vf140() != ViewMode_0) {
+ } else if (inDoc->GetViewMode() != kInView) {
DrawViewModeColor(inDoc);
}
@@ -326,7 +326,7 @@ void T2Tenant::LeaveTenant(T2TowerDoc* inDoc, T2People* inPeople) {
unsigned int result = GetEquipDef()->IdleProc(this, inDoc);
if (result != -1 && result > 0) {
- inDoc->GetTowerMainView()->tmv_vf128(mArea);
+ inDoc->GetMainView()->InvalUnitRect(mArea);
mDrawMode = DrawMode1;
}
@@ -666,7 +666,7 @@ void T2Tenant::StartBuild() {
mStatus = kTenantStatus1;
} else {
mStatus = kTenantStatus2;
- mTenantNumber = GetCurrentT2TowerDoc()->towerDoc_vf27C(mArea.bottom - 1);
+ mTenantNumber = GetCurrentT2TowerDoc()->GetNextTenantNumber(mArea.bottom - 1);
}
((T2TenantDef *) GetEquipDef())->BuildStartProc(GetCurrentT2TowerDoc(), this);
@@ -693,7 +693,7 @@ int T2Tenant::CollectCustomerFromPool(T2TowerDoc* inDoc, T2TenantMemberTableDef*
unsigned int checkRoute = CheckRouteFromPool(inDoc, searchScore);
if (checkRoute > 0) {
- T2Pool *thePool = inDoc->towerDoc_vf130();
+ T2Pool *thePool = inDoc->GetPool();
unsigned int restCapacity = CalcRestCapacity();
int econoType = inTable->GetEconoType();
@@ -731,7 +731,7 @@ int T2Tenant::CollectCustomerFromPool(T2TowerDoc* inDoc, T2TenantMemberTableDef*
int T2Tenant::CollectCustomerFromTenant(T2TowerDoc* inDoc, T2TenantMemberTableDef* inTable, unsigned int inTime) {
int numCustomer = 0;
- T2RouteNavigator *theNavi = inDoc->towerDoc_vf124();
+ T2RouteNavigator *theNavi = inDoc->GetRouteNavi();
T2Tenant *theNearTenant = theNavi->SelectNearTenant(GetEntrancePt(), inTable->GetScore(T2PlaceParamDef::Place_1));
if (theNearTenant) {
@@ -772,7 +772,7 @@ int T2Tenant::CollectCustomerFromTenant(T2TowerDoc* inDoc, T2TenantMemberTableDe
int T2Tenant::CollectCustomerFromFloor(T2TowerDoc* inDoc, T2TenantMemberTableDef* inTable, unsigned int inTime) {
int numCustomer = 0;
- T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C();
+ T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo();
unsigned int theEntranceFloorID = GetEntranceFloorID();
T2Tenant *theFloor = theFloorInfo->GetTenant(theEntranceFloorID);
@@ -817,7 +817,7 @@ int T2Tenant::CollectCustomerFromFloor(T2TowerDoc* inDoc, T2TenantMemberTableDef
void T2Tenant::CollectCustomer(T2TowerDoc* inDoc, T2Tenant* inTenant) {
if (!WillBeFull()) {
- T2DateTime *theNow = inDoc->towerDoc_vf120();
+ T2DateTime *theNow = inDoc->GetNow();
if (theNow->WithinMinutes(GetOpenTime(), GetCloseTime() - GetBindTime() - 60)) {
T2TenantMemberTableDef *theTable = GetCustomerTableDef(true);
if (theTable) {
@@ -913,7 +913,7 @@ void T2Tenant::PushOutPeople(T2TowerDoc* inDoc, T2People* inPeople) {
if (inPeople->IsSetReturn())
inPeople->SetReturnToDestination();
else
- inPeople->SetDestination(inPeople->mHomeTenant, inDoc->towerDoc_vf120()->GetRawMinutes() + 180);
+ inPeople->SetDestination(inPeople->mHomeTenant, inDoc->GetNow()->GetRawMinutes() + 180);
}
LeaveTenant(inDoc, inPeople);
@@ -1068,7 +1068,7 @@ int T2Tenant::GetNumOfKind() const {
/*virtual*/ void T2Tenant::SetUsed(BOOL used) {
if (!used && IsFavorite())
- GetCurrentT2TowerDoc()->towerDoc_vf1CC(this, false);
+ GetCurrentT2TowerDoc()->RemoveFavoriteTenant(this, false);
T2Equip::SetUsed(used);
@@ -1146,13 +1146,13 @@ void T2Tenant::Destruct(T2TowerDoc* inDoc, CRect& outRect) {
T2FloorInfo *theFloorInfo = inDoc->mFloorInfo;
if (theFloorInfo) {
if (IsFloor()) {
- inDoc->towerDoc_vf124()->FloorRemoved(this, false);
+ inDoc->GetRouteNavi()->FloorRemoved(this, false);
theFloorInfo->FillTenantID(outRect, 0);
outRect.left -= theFloorInfo->GetEntranceWidth();
outRect.right += theFloorInfo->GetEntranceWidth();
} else {
RemovePeople(inDoc);
- inDoc->towerDoc_vf268(this);
+ inDoc->TenantRemoved(this);
RECT rect = outRect;
rect.top = rect.bottom - 1;
@@ -1297,7 +1297,7 @@ BOOL T2Tenant::IsWithinSearchRange(T2TowerDoc* inDoc, T2Tenant* inTenant) const
BOOL result = false;
if (inTenant) {
- T2RouteNavigator *theNavi = inDoc->towerDoc_vf124();
+ T2RouteNavigator *theNavi = inDoc->GetRouteNavi();
T2TenantMemberTableDef *theTable = inTenant->GetCustomerTableDef(true);
if (theTable) {
@@ -1339,7 +1339,7 @@ int T2Tenant::GetRoomNumber(T2FloorInfo* inFloorInfo) const {
void T2Tenant::GetRoomName(T2TowerDoc* inDoc, CString& outStr) const {
CString roomNum;
- UT2Utils::GetRoomNumberString(inDoc->towerDoc_vf12C()->UnitToFloor(mArea.bottom - 1), roomNum);
+ UT2Utils::GetRoomNumberString(inDoc->GetFloorInfo()->UnitToFloor(mArea.bottom - 1), roomNum);
outStr += roomNum;
outStr += "\x8A\x4B";
@@ -1359,9 +1359,9 @@ void T2Tenant::GetRoomName(T2TowerDoc* inDoc, CString& outStr) const {
}
/*virtual*/ void T2Tenant::PlaySound(T2TowerDoc* inDoc, int inID, unsigned int inMask, unsigned int inFlags) const {
- if (inDoc->towerDoc_vf15C(mArea)) {
+ if (inDoc->IsRectInView(mArea)) {
T2EquipDef *theDef = GetEquipDef();
- T2SoundPlayer *thePlayer = inDoc->towerDoc_vf134();
+ T2SoundPlayer *thePlayer = inDoc->GetSoundPlayer();
if (theDef && thePlayer) {
CRect rect;
GetEquipArea(rect);
@@ -1423,11 +1423,11 @@ void T2Tenant::DrawViewModeColor(T2TowerDoc* inDoc) const {
T2Tenant *tenant;
int color = -1;
- switch (inDoc->towerDoc_vf140()) {
- case ViewMode_2:
+ switch (inDoc->GetViewMode()) {
+ case kEvalView:
color = CalcEstimateColor();
break;
- case ViewMode_3:
+ case kPriceView:
switch (GetPriceIndex()) {
case 4:
color = 9;
@@ -1443,12 +1443,12 @@ void T2Tenant::DrawViewModeColor(T2TowerDoc* inDoc) const {
break;
}
break;
- case ViewMode_4:
+ case kMaintView:
if (GetRegistID() == kTenantRegistID1 && GetStatus() >= kTenantStatus35)
color = 9;
break;
case ViewMode_6:
- tenant = inDoc->towerDoc_vf18C();
+ tenant = inDoc->GetSearchRangeFrom();
if (tenant) {
if (this == tenant)
color = 14;
@@ -1465,7 +1465,7 @@ void T2Tenant::DrawViewModeColor(T2TowerDoc* inDoc) const {
}
void T2Tenant::DrawTrafficColor(T2TowerDoc* inDoc, const CRect& inRect) const {
- T2TrafficInfo *theTrafficInfo = inDoc->towerDoc_vf150();
+ T2TrafficInfo *theTrafficInfo = inDoc->GetTrafficInfo();
CRect rect1 = inRect;
if (inRect.Height() > 1) {
@@ -1512,7 +1512,7 @@ void T2Tenant::DrawTrafficColor(T2TowerDoc* inDoc, const CRect& inRect) const {
CRect qdRect;
UT2Coordinate::UnitToQD(inRect, qdRect, inDoc->mZoomLevel);
- inDoc->towerDoc_vf10C()->FillMesh(qdRect, T2PaletteAnimeDef::GetCommonColor(inClr));
+ inDoc->GetImage()->FillMesh(qdRect, T2PaletteAnimeDef::GetCommonColor(inClr));
}
void T2Tenant::IncPeopleEstimate(int inEstimate) {
@@ -1543,12 +1543,12 @@ BOOL T2Tenant::CollectEmployeeFromPool(T2TowerDoc* inDoc, T2TenantMemberTableDef
BOOL found = false;
int searchScore = inTable->GetScore(T2PlaceParamDef::Place_0);
- T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C();
- T2RouteNavigator *theNavigator = inDoc->towerDoc_vf124();
+ T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo();
+ T2RouteNavigator *theNavigator = inDoc->GetRouteNavi();
unsigned int checkRoute = CheckRouteFromPool(inDoc, searchScore);
if (checkRoute > 0) {
- T2Pool *thePool = inDoc->towerDoc_vf130();
+ T2Pool *thePool = inDoc->GetPool();
int econoType = inTable->GetEconoType();
BOOL checkOnlyFirstEconoType = inTable->IsCheckOnlyFirstEconoType();
if (thePool->Find(inTable, econoType, checkRoute, checkOnlyFirstEconoType)) {
@@ -1567,7 +1567,7 @@ BOOL T2Tenant::CollectEmployeeFromPool(T2TowerDoc* inDoc, T2TenantMemberTableDef
found = true;
- T2DateTime *theNow = inDoc->towerDoc_vf120();
+ T2DateTime *theNow = inDoc->GetNow();
mResideDay = theNow->CalcTotalDays();
}
}
@@ -1587,23 +1587,23 @@ BOOL T2Tenant::IsRegist() const {
unsigned int T2Tenant::CheckRouteFromPool(T2TowerDoc* inDoc, unsigned int inScore) const {
unsigned int checkRoute = 0;
- T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C();
- T2RouteNavigator *theNavi = inDoc->towerDoc_vf124();
+ T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo();
+ T2RouteNavigator *theNavi = inDoc->GetRouteNavi();
POINT entrancePt = GetEntrancePt();
if (theNavi->CheckRoute(theFloorInfo->GetEntrancePt(1000), entrancePt, inScore))
checkRoute |= kTransportFlagLobbyLeft | kTransportFlagLobbyRight;
- T2RegistedTenantDB *theDB = inDoc->towerDoc_vf174();
+ T2RegistedTenantDB *theDB = inDoc->GetRegistedTenantDB();
T2Tenant *theEmptyParking = theDB->FindEmptyParking();
if (theEmptyParking) {
if (theNavi->CheckRoute(theEmptyParking->GetExitPt(), entrancePt, inScore))
checkRoute |= kTransportFlagParking;
}
- T2TowerEvent *theEvent = inDoc->towerDoc_vf170()->GetTowerEvent();
- T2DateTime *theCurrentDateTime = inDoc->towerDoc_vf120();
+ T2TowerEvent *theEvent = inDoc->GetWorldDef()->GetTowerEvent();
+ T2DateTime *theCurrentDateTime = inDoc->GetNow();
theEmptyParking = theDB->GetFirstTenant(kTenantRegistID8);
if (theEmptyParking && theEmptyParking->IsOpen()) {
if (theNavi->CheckRoute(theEmptyParking->GetExitPt(), entrancePt, inScore))
@@ -1671,7 +1671,7 @@ BOOL T2Tenant::UpdateResidencialEstimate(T2TowerDoc* inDoc) {
int senseOfNoise = ((T2TenantDef *) GetEquipDef())->GetSenseOfNoise();
if (senseOfNoise != 0) {
- T2TrafficInfo *theTrafficInfo = inDoc->towerDoc_vf150();
+ T2TrafficInfo *theTrafficInfo = inDoc->GetTrafficInfo();
if (theTrafficInfo)
mEstimate -= senseOfNoise * theTrafficInfo->GetRange(GetEntrancePt());
}
@@ -1679,7 +1679,7 @@ BOOL T2Tenant::UpdateResidencialEstimate(T2TowerDoc* inDoc) {
if (GetPriceIndex() != 0)
mEstimate += (GetPriceIndex() - 3) * -30;
- mEstimate += inDoc->towerDoc_vf120()->CalcLapseYears(mBuildDay) * -1;
+ mEstimate += inDoc->GetNow()->CalcLapseYears(mBuildDay) * -1;
} else {
mEstimate = 1;
}
@@ -1697,7 +1697,7 @@ void T2Tenant::BreakoutEmergency(T2TowerDoc* inTowerDoc) {
int result = GetEquipDef()->EmergencyProc(inTowerDoc, this);
if (result) {
SetDrawMode(result);
- inTowerDoc->GetTowerMainView()->tmv_vf128(mArea);
+ inTowerDoc->GetMainView()->InvalUnitRect(mArea);
}
}
}
@@ -1712,7 +1712,7 @@ void T2Tenant::BurntDown(T2TowerDoc* inDoc) {
GetEquipDef()->BurntDownProc(inDoc, this);
mDrawMode = DrawMode1;
- inDoc->GetTowerMainView()->tmv_vf128(mArea);
+ inDoc->GetMainView()->InvalUnitRect(mArea);
}
}
@@ -1887,7 +1887,7 @@ void T2Tenant::SetMerchandise(int inCount, int* inArray) {
void T2Tenant::SetRelatedTenant(T2TowerDoc* inDoc, unsigned int inRegistID) {
if (!mRelatedTenantList) {
- T2RegistedTenantDB *theDB = inDoc->towerDoc_vf174();
+ T2RegistedTenantDB *theDB = inDoc->GetRegistedTenantDB();
mRelatedTenantList = theDB->GetList(inRegistID);
}