test: capture legacy battle parity fixtures
This commit is contained in:
@@ -40,6 +40,25 @@ function processWar(string $warSeed, General $attackerGeneral, array $rawAttacke
|
||||
$defenderCityGeneralIDList = $db->queryFirstColumn('SELECT no FROM general WHERE nation=%i AND city=%i AND nation!=0', $city->getVar('nation'), $city->getVar('city'));
|
||||
$defenderCityGeneralList = General::createObjListFromDB($defenderCityGeneralIDList, null);
|
||||
|
||||
$captureBattleFixture =
|
||||
PHP_SAPI === 'cli'
|
||||
&& getenv('REF_DETERMINISTIC_INSTALL_ENABLED') === '1'
|
||||
&& getenv('REF_BATTLE_FIXTURE_TRACE') === '1';
|
||||
if ($captureBattleFixture) {
|
||||
require_once __DIR__ . '/compare/battle_fixture_capture.php';
|
||||
fwrite(STDOUT, 'AI_WAR_FIXTURE_REF ' . Json::encode(comparisonBuildBattleFixture(
|
||||
$warSeed,
|
||||
(int)$year,
|
||||
(int)$month,
|
||||
(int)$startYear,
|
||||
$attackerGeneral,
|
||||
$rawAttackerNation,
|
||||
$defenderCityGeneralList,
|
||||
$rawDefenderCity,
|
||||
$rawDefenderNation,
|
||||
)) . "\n");
|
||||
}
|
||||
|
||||
/** @var WarUnit[] */
|
||||
$defenderList = [];
|
||||
$defenderCandidateTrace = [];
|
||||
|
||||
Reference in New Issue
Block a user