Add a persistent event log for shop and prep actions.

This commit is contained in:
Greyson Parrelli
2026-07-23 08:00:59 -04:00
parent f7a00f6c48
commit 506c6e5b55
7 changed files with 330 additions and 9 deletions
+3
View File
@@ -35,6 +35,8 @@ type View struct {
Pending *PendingTrade `json:"pending,omitempty"`
Battle *BattleResult `json:"battle,omitempty"`
WinnerSeat int `json:"winnerSeat"`
// Log is the shared, public event log shown across every phase.
Log []LogEntry `json:"log,omitempty"`
// Debug is set by the server when its DEBUG flag is on, unlocking the
// client's "buy any card" panel. Not part of the pure game state.
Debug bool `json:"debug,omitempty"`
@@ -54,6 +56,7 @@ func (g *Game) ViewFor(playerID string) View {
PrioritySeat: g.PrioritySeat,
ShopRow: g.ShopRow,
WinnerSeat: g.WinnerSeat,
Log: g.Log,
}
for _, deck := range g.ShopDecks {
v.DeckCounts = append(v.DeckCounts, len(deck))