feat(games): unify ApplyMove signatures + remove unused player conversion
Updated TicTacToeRules and BattleshipRules to implement ApplyMove(state, playerIdx, payload) (bool, bool, int) as required by GameRules. Added win/draw resolution logic directly inside each game’s ApplyMove return. Removed obsolete convertToGamePlayers helper. Updated GenericMatch to call AssignPlayerSymbols with []*structs.Player directly. Ensured all rule implementations now fully satisfy the GameRules interface.
This commit is contained in:
@@ -12,7 +12,7 @@ type GameRules interface {
|
||||
MaxPlayers() int
|
||||
|
||||
// Assign symbols/colors/pieces at start.
|
||||
AssignPlayerSymbols(players []*Player)
|
||||
AssignPlayerSymbols(players []*structs.Player)
|
||||
|
||||
// Apply a move.
|
||||
// Returns: (changed, gameOver, winnerIndex)
|
||||
|
||||
Reference in New Issue
Block a user