refactor: group uuid instead of index

This commit is contained in:
IliaDenisov
2026-02-10 20:54:43 +03:00
parent 6c8384ce7a
commit 56998d4c2d
26 changed files with 333 additions and 363 deletions
+6 -6
View File
@@ -28,8 +28,8 @@ func (c *Cache) FleetSend(ri, fi int, planetNumber uint) error {
return e.NewSendUnreachableDestinationError("range=%.03f", rangeToDestination)
}
for sg := range c.FleetGroups(ri, fi) {
st := c.MustShipType(ri, sg.TypeID)
for sgi := range c.FleetGroupIdx(ri, fi) {
st := c.MustShipType(ri, c.ShipGroup(sgi).TypeID)
if st.DriveBlockMass() == 0 {
return e.NewSendShipHasNoDrivesError("Class=%s", st.Name)
}
@@ -48,15 +48,15 @@ func (c *Cache) FleetSend(ri, fi int, planetNumber uint) error {
func (c *Cache) LaunchFleet(ri, fi int, destination uint) {
c.validateRaceIndex(ri)
c.validateFleetIndex(fi)
for sg := range c.FleetGroups(ri, fi) {
c.LaunchShips(sg, destination)
for sgi := range c.FleetGroupIdx(ri, fi) {
c.LaunchShips(sgi, destination)
}
}
func (c *Cache) UnsendFleet(ri, fi int) {
c.validateRaceIndex(ri)
c.validateFleetIndex(fi)
for sg := range c.FleetGroups(ri, fi) {
c.UnsendShips(sg)
for sgi := range c.FleetGroupIdx(ri, fi) {
c.UnsendShips(sgi)
}
}