summaryrefslogtreecommitdiff
path: root/src/Plugins/Common/StdFoodInfoDialog.cpp
blob: 6b40903c90e160d4eeaa9503962e6b74b5e9307f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "StdAfx.h"
#include "../Food/Common/Trash.h"
#include "StdFoodInfoDialog.h"
#include "../../T2DLL/T2EquipPtrList.h"
#include "../../T2DLL/T2RouteNavigator.h"
#include "../../T2DLL/T2Tenant.h"
#include "../../T2TowerDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

StdFoodInfoDialog::StdFoodInfoDialog(T2Tenant *inTenant)
    : StdShopInfoDialog(inTenant)
{
}

StdFoodInfoDialog::~StdFoodInfoDialog() {
}

/*virtual*/ void StdFoodInfoDialog::GenerateComments() {
    StdShopInfoDialog::GenerateComments();

    if (GetDocument()->IsDustOn()) {
        T2EquipPtrList *theTrashFacilityList = GetTrashFacilities(GetDocument(), GetTenant());
        if (!theTrashFacilityList || theTrashFacilityList->GetCount() == 0) {
            // EN: There's no Trash Facility.
            AppendComment(14);
        } else {
            T2RouteNavigator *theNavi = GetDocument()->GetRouteNavi();
#line 48
            _ASSERT(theNavi != NULL);

            BOOL isNotConnected = true;
            T2Tenant *tenant = NULL;
            POINT theTenantExit = GetTenant()->GetExitPt();

            LArrayIterator iterator(*theTrashFacilityList);
            while (iterator.Next(&tenant)) {
                if (theNavi->CheckRoute(theTenantExit, tenant->GetEntrancePt(), 1000, kRouteType1)) {
                    isNotConnected = false;
                    break;
                }
            }

            if (isNotConnected) {
                // EN: Item not connected to Trash Facility.
                AppendComment(15);
            }
        }
    }

    if (GetTenant()->GetWorkCount() >= 3) {
        // EN: Forced to close.
        AppendComment(16);
    } else if (GetTenant()->GetWorkCount() > 0) {
        // EN: Full of garbage.
        AppendComment(15);
    }
}

/*virtual*/ BOOL StdFoodInfoDialog::GenerateStatusProc(CString &outStr, BOOL &outIsBad) {
    BOOL result = false;

    if (GetTenant()->GetWorkCount() >= 3) {
        // "営業停止" - Suspension of business
        outStr = "\x89\x63\x8B\xC6\x92\xE2\x8E\x7E";
        outIsBad = true;
        result = true;
    }

    return result;
}