refactor: group uuid instead of index
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user