feat: enroute groups

This commit is contained in:
Ilia Denisov
2026-01-16 22:20:27 +02:00
parent 16aba8435d
commit 741a5f726b
8 changed files with 299 additions and 9 deletions
+2 -8
View File
@@ -1,8 +1,6 @@
package controller
import (
// "github.com/iliadenisov/galaxy/internal/controller"
e "github.com/iliadenisov/galaxy/internal/error"
// "github.com/iliadenisov/galaxy/internal/game/battle"
"github.com/iliadenisov/galaxy/internal/model/game"
)
@@ -17,12 +15,8 @@ func MakeTurn(c *Controller, r Repo, g *game.Game) error {
// 02. Враждующие корабли вступают в схватку.
battles := ProduceBattles(c.Cache)
// Internal control: after battles there are can't be groups with no ships left
for i := range g.ShipGroups {
if g.ShipGroups[i].Number == 0 {
return e.NewGameStateError("")
}
}
// 03. Товары загружаются на корабли, находящиеся в начале грузовых маршрутов, и корабли входят в гиперпространство.
c.Cache.EnrouteGroups()
/*** Last steps ***/