feat: wire config into main, server, and lobby

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 13:02:54 +09:00
parent 0f524779c0
commit ad1482ae03
5 changed files with 49 additions and 20 deletions

View File

@@ -1,12 +1,13 @@
package ui
import (
"os"
"testing"
tea "github.com/charmbracelet/bubbletea"
"github.com/tolelom/catacombs/config"
"github.com/tolelom/catacombs/game"
"github.com/tolelom/catacombs/store"
"os"
)
func testDB(t *testing.T) *store.DB {
@@ -18,7 +19,7 @@ func testDB(t *testing.T) *store.DB {
}
func TestTitleToLobby(t *testing.T) {
lobby := game.NewLobby()
lobby := game.NewLobby(func() *config.Config { c, _ := config.Load(""); return c }())
db := testDB(t)
defer func() { db.Close(); os.Remove("test_ui.db") }()
@@ -55,7 +56,7 @@ func TestTitleToLobby(t *testing.T) {
}
func TestLobbyCreateRoom(t *testing.T) {
lobby := game.NewLobby()
lobby := game.NewLobby(func() *config.Config { c, _ := config.Load(""); return c }())
db := testDB(t)
defer func() { db.Close(); os.Remove("test_ui.db") }()
@@ -86,7 +87,7 @@ func TestLobbyCreateRoom(t *testing.T) {
}
func TestClassSelectToGame(t *testing.T) {
lobby := game.NewLobby()
lobby := game.NewLobby(func() *config.Config { c, _ := config.Load(""); return c }())
db := testDB(t)
defer func() { db.Close(); os.Remove("test_ui.db") }()