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:
@@ -22,11 +22,6 @@ func InitModule(
|
||||
//--------------------------------------------------------
|
||||
// 1. Register RPCs
|
||||
//--------------------------------------------------------
|
||||
if err := initializer.RegisterRpc("hello_world", HelloWorld); err != nil {
|
||||
logger.Error("Failed to register RPC hello_world: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
if err := initializer.RegisterRpc("leave_matchmaking", modules.RpcLeaveMatchmaking); err != nil {
|
||||
logger.Error("Failed to register RPC leave_matchmaking: %v", err)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user