feat: load player's report
This commit is contained in:
@@ -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: ".",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user