diff --git a/hwe/compare/fixtures/monthly_process_war_income.json b/hwe/compare/fixtures/monthly_process_war_income.json new file mode 100644 index 00000000..835b9776 --- /dev/null +++ b/hwe/compare/fixtures/monthly_process_war_income.json @@ -0,0 +1,96 @@ +{ + "action": "ProcessWarIncome", + "environment": { + "year": 193, + "month": 1, + "startyear": 190 + }, + "setup": { + "resetCities": true, + "nation": [ + { + "id": 1, + "values": { + "name": "전쟁수입국", + "gold": 1000, + "level": 1, + "type": "che_중립" + } + }, + { + "id": 2, + "values": { + "name": "비활성국", + "gold": 2000, + "level": 0, + "type": "che_중립" + } + }, + { + "id": 3, + "values": { + "name": "법가국", + "gold": 3000, + "level": 1, + "type": "che_법가" + } + } + ], + "city": [ + { + "id": 1, + "values": { + "nation": 1, + "supply": 1, + "pop": 1000, + "pop_max": 2000, + "dead": 101 + } + }, + { + "id": 2, + "values": { + "nation": 1, + "supply": 0, + "pop": 1000, + "pop_max": 2000, + "dead": 999 + } + }, + { + "id": 3, + "values": { + "nation": 2, + "supply": 1, + "pop": 1000, + "pop_max": 2000, + "dead": 1000 + } + }, + { + "id": 4, + "values": { + "nation": 3, + "supply": 1, + "pop": 1000, + "pop_max": 2000, + "dead": 105 + } + }, + { + "id": 5, + "values": { + "nation": 0, + "supply": 1, + "pop": 999, + "pop_max": 1000, + "dead": 10 + } + } + ] + }, + "observe": { + "cityIds": [1, 2, 3, 4, 5], + "nationIds": [1, 2, 3] + } +} diff --git a/hwe/compare/monthly_event_trace.php b/hwe/compare/monthly_event_trace.php index 934aae33..69412e70 100644 --- a/hwe/compare/monthly_event_trace.php +++ b/hwe/compare/monthly_event_trace.php @@ -179,7 +179,13 @@ function comparisonMonthlyEventTraceMain(): void throw new \InvalidArgumentException('request must be an object'); } $actionName = $request['action'] ?? null; - if (!in_array($actionName, ['UpdateCitySupply', 'UpdateNationLevel', 'ProcessSemiAnnual'], true)) { + $supportedActions = [ + 'UpdateCitySupply', + 'UpdateNationLevel', + 'ProcessSemiAnnual', + 'ProcessWarIncome', + ]; + if (!in_array($actionName, $supportedActions, true)) { throw new \InvalidArgumentException('unsupported monthly action'); } $setup = $request['setup'] ?? [];