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:
@@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user