Let players peek both decks during and after a battle

Record each seat's arranged lineup on the battle result (already public)
and reveal the full deck in a popover when hovering a deck pile in the
battle view — the opponent's included.
This commit is contained in:
Greyson Parrelli
2026-07-23 01:12:36 -04:00
parent c641e4fc20
commit 7eb4812f86
5 changed files with 91 additions and 7 deletions
+18
View File
@@ -696,3 +696,21 @@ func TestPriorityTokenTransfer(t *testing.T) {
t.Fatalf("a draw should leave the token put, priority=%d", g.PrioritySeat)
}
}
// TestBattleResultExposesLineups: both seats' arranged decks are recorded on
// the result so players can peek the whole matchup.
func TestBattleResultExposesLineups(t *testing.T) {
g, _, _ := testGame(t)
res := forceBattle(t, g,
[]Card{g.pet("A", 3), g.pet("B", 2)},
[]Card{g.pet("C", 4)})
if len(res.Lineups) != 2 {
t.Fatalf("expected a lineup per seat, got %d", len(res.Lineups))
}
if len(res.Lineups[0]) != 2 || res.Lineups[0][0].Name != "A" {
t.Fatalf("seat 0 lineup should mirror its arranged deck: %+v", res.Lineups[0])
}
if len(res.Lineups[1]) != 1 || res.Lineups[1][0].Name != "C" {
t.Fatalf("seat 1 lineup should mirror its arranged deck: %+v", res.Lineups[1])
}
}