mirror of
https://github.com/tiennm99/gomoku.git
synced 2026-05-24 12:26:09 +00:00
acf08669dd
- Split monolithic database.go/model.go/gomoku.go into focused files: player.go, room.go, store.go, errors.go, events.go, cleanup.go - NewRoom embeds game.Board directly; carries blackPlayerId, whitePlayerId, currentTurn, moveHistory, spectators, owner, type, difficulty from caro domain - Store singleton with sync.RWMutex: RegisterPlayer, CreatePvpRoom, CreatePveRoom, JoinNewRoom, LeaveNewRoom, WatchNewRoom, UnwatchNewRoom, BroadcastToNewRoom - PVE rooms randomly assign human to Black or White; AI takes opposite side - legacy.go shim keeps server/state/*.go and state/game/gomoku.go compiling without modification until phase-06 rewrites them - consts/const.go: add RoomTypePvp/Pve, Status*, RoomStatus*, Difficulty* enums