feat: store battles and bombings

This commit is contained in:
Ilia Denisov
2026-01-30 18:57:43 +03:00
parent 824f6609ab
commit 4c14234afb
16 changed files with 274 additions and 103 deletions
+6 -2
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/iliadenisov/galaxy/internal/model/game"
"github.com/iliadenisov/galaxy/internal/model/report"
"github.com/iliadenisov/galaxy/internal/repo"
)
@@ -26,8 +27,11 @@ type Repo interface {
// LoadStateSafe retrieves game current state without preliminary locking
LoadStateSafe() (*game.Game, error)
// SaveBattle stores
SaveBattle(t uint, b *game.BattleReport) error
// SaveBattle stores a new battle protocol and battle meta data for turn t
SaveBattle(t uint, b *report.BattleReport, m *game.BattleMeta) error
// SaveBombing stores all prodused bombings for turn t
SaveBombings(t uint, b []report.BombingPlanetReport) error
}
type Controller struct {