feat: load player's report

This commit is contained in:
Ilia Denisov
2026-02-08 20:47:46 +02:00
parent f8412be248
commit e48a0c8b96
16 changed files with 91 additions and 35 deletions
+6 -2
View File
@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"github.com/google/uuid"
"github.com/iliadenisov/galaxy/internal/model/game"
"github.com/iliadenisov/galaxy/internal/model/report"
"github.com/iliadenisov/galaxy/internal/repo"
@@ -36,6 +37,9 @@ type Repo interface {
// SaveReport stores latest report for a race
SaveReport(uint, *report.Report) error
// LoadReport loads report for specific turn and player id
LoadReport(uint, uuid.UUID) (*report.Report, error)
}
type Controller struct {
@@ -47,9 +51,9 @@ type Param struct {
StoragePath string
}
type Config func(*Param)
type Configurer func(*Param)
func NewController(config Config) (*Controller, error) {
func NewController(config Configurer) (*Controller, error) {
c := &Param{
StoragePath: ".",
}