Files
tic-tac-toe/plugins/structs/match_state.go
Vishesh 'ironeagle' Bangotra f1e85a72dd feat(rules): add game-specific metadata attachment and unify match metadata initialization
Added AttachGameMetadata to GameRules interface

Implemented metadata setup for Battleship (phase + readiness flags)

Implemented no-op metadata hook for TicTacToe

Moved generic phase/ready metadata out of MatchInit

Added game/mode metadata to match state

Fixed json:"metadata" tag in MatchState
2025-12-03 22:02:24 +05:30

12 lines
542 B
Go

package structs
// MatchState holds the full game session state.
type MatchState struct {
Players []*Player `json:"players"`
Boards map[string]*Board `json:"boards"` // Multiple named boards:
Turn int `json:"turn"` // index in Players[]
Winner int `json:"winner"` // -1 = none, >=0 = winner index
GameOver bool `json:"game_over"` // true when the match ends
Metadata map[string]interface{} `json:"metadata"` // metadata
}