Simplify codebase and fix Enter key on home page

- Enter key now triggers createGame action on home page
- Remove redundant setNickname action from home page
- Remove unused code: join channel, Leave(), Stop() methods
- Consolidate ID generation into game.GenerateID()
- Remove unused CreatedAt field from Game struct
This commit is contained in:
Ryan Hamamura
2026-01-14 14:10:18 -10:00
parent 389fc12bf2
commit 63d0773ab5
6 changed files with 34 additions and 61 deletions

View File

@@ -1,7 +1,5 @@
package game
import "time"
type PlayerID string
type Player struct {
@@ -27,7 +25,6 @@ type Game struct {
Status GameStatus
Winner *Player
WinningCells [][2]int // Coordinates of winning 4 cells for highlighting
CreatedAt time.Time
}
func NewGame(id string) *Game {
@@ -36,6 +33,5 @@ func NewGame(id string) *Game {
Board: [6][7]int{},
CurrentTurn: 1, // Red goes first
Status: StatusWaitingForPlayer,
CreatedAt: time.Now(),
}
}