compare: expose status transition fields
This commit is contained in:
@@ -380,6 +380,8 @@ function comparisonApplyTurnFixtureSetup(mixed $setup): void
|
||||
'dex3' => 'dex3',
|
||||
'dex4' => 'dex4',
|
||||
'dex5' => 'dex5',
|
||||
'specAge' => 'specage',
|
||||
'specAge2' => 'specage2',
|
||||
'killTurn' => 'killturn',
|
||||
'npcState' => 'npc',
|
||||
'blockState' => 'block',
|
||||
@@ -394,6 +396,12 @@ function comparisonApplyTurnFixtureSetup(mixed $setup): void
|
||||
if (isset($row['meta'])) {
|
||||
$patch['aux'] = Json::encode($row['meta']);
|
||||
}
|
||||
if (array_key_exists('penalty', $row)) {
|
||||
if (!is_array($row['penalty'])) {
|
||||
throw new \InvalidArgumentException('setup.generals.penalty must be an object');
|
||||
}
|
||||
$patch['penalty'] = Json::encode($row['penalty']);
|
||||
}
|
||||
if (isset($row['lastTurn']) && is_array($row['lastTurn'])) {
|
||||
$patch['last_turn'] = Json::encode($row['lastTurn']);
|
||||
}
|
||||
|
||||
@@ -292,6 +292,7 @@ function comparisonTurnStateSnapshot(array $request): array
|
||||
'recentWarTime' => 'recent_war',
|
||||
'lastTurn' => 'last_turn',
|
||||
'meta' => 'aux',
|
||||
'penalty' => 'penalty',
|
||||
'leadershipExp' => 'leadership_exp',
|
||||
'strengthExp' => 'strength_exp',
|
||||
'intelExp' => 'intel_exp',
|
||||
@@ -300,6 +301,8 @@ function comparisonTurnStateSnapshot(array $request): array
|
||||
'dex3' => 'dex3',
|
||||
'dex4' => 'dex4',
|
||||
'dex5' => 'dex5',
|
||||
'specAge' => 'specage',
|
||||
'specAge2' => 'specage2',
|
||||
'killTurn' => 'killturn',
|
||||
'mySet' => 'myset',
|
||||
'specialDomestic' => 'special',
|
||||
@@ -310,7 +313,7 @@ function comparisonTurnStateSnapshot(array $request): array
|
||||
'itemBook' => 'book',
|
||||
'itemExtra' => 'item',
|
||||
],
|
||||
['last_turn', 'aux'],
|
||||
['last_turn', 'aux', 'penalty'],
|
||||
);
|
||||
foreach ([
|
||||
'specialDomestic',
|
||||
|
||||
Reference in New Issue
Block a user