package games import "localrepo/plugins/structs" // MovePayload is used for incoming move data from clients. type MovePayload struct { Data map[string]interface{} `json:"data"` } type GameRules interface { // Number of players needed to start. MaxPlayers() int // Assign symbols/colors/pieces at start. AssignPlayerSymbols(players []*structs.Player) // Apply a move. // Returns: (changed, gameOver, winnerIndex) ApplyMove(state *structs.MatchState, playerIdx int, payload MovePayload) (bool, bool, int) // If a player leaves, who wins? // Return: // >=0 → winner index // -1 → draw // -2 → invalid ForfeitWinner(state *structs.MatchState, leaverIndex int) int }