feat: moge groups in hyperspace

This commit is contained in:
Ilia Denisov
2026-01-18 22:38:11 +02:00
parent 741a5f726b
commit bd9db26ef4
12 changed files with 273 additions and 20 deletions
+19
View File
@@ -250,6 +250,25 @@ func (c *Cache) FleetGroups(ri, fi int) iter.Seq[*game.ShipGroup] {
}
}
func (c *Cache) fleetGroupIds(ri, fi int) iter.Seq[int] {
c.validateRaceIndex(ri)
c.validateFleetIndex(fi)
return func(yield func(int) bool) {
for i := range c.ShipGroupsIndex() {
sg := c.ShipGroup(i)
if c.g.Race[ri].ID != sg.OwnerID {
continue
}
if sg.FleetID == nil || c.MustFleetIndex(*sg.FleetID) != fi {
continue
}
if !yield(i) {
return
}
}
}
}
func (c *Cache) listFleets(ri int) iter.Seq[*game.Fleet] {
c.validateRaceIndex(ri)
return func(yield func(*game.Fleet) bool) {