refactor: group launched/in_space state

This commit is contained in:
Ilia Denisov
2026-02-08 19:29:38 +02:00
parent 077c0999d2
commit b928bb2976
14 changed files with 43 additions and 62 deletions
+2 -5
View File
@@ -92,17 +92,14 @@ func TestJoinShipGroupToFleet(t *testing.T) {
// group not In_Orbit
assert.NoError(t, c.CreateShips(Race_0_idx, Race_0_Gunship, R0_Planet_0_num, 7))
gi = 3
c.ShipGroup(gi).StateInSpace = &game.InSpace{
Origin: 2,
Range: 1,
}
c.ShipGroup(gi).StateInSpace = &InSpace
assert.ErrorContains(t,
g.JoinShipGroupToFleet(Race_0.Name, fleetOne, c.ShipGroup(gi).Index, 0),
e.GenericErrorText(e.ErrShipsBusy))
c.ShipGroup(gi).StateInSpace = nil
// existing fleet not on the same planet or in_orbit
c.ShipGroup(0).StateInSpace = &game.InSpace{Origin: 2, Range: 1}
c.ShipGroup(0).StateInSpace = &InSpace
c.ShipGroup(1).StateInSpace = c.ShipGroup(0).StateInSpace
assert.ErrorContains(t,
g.JoinShipGroupToFleet(Race_0.Name, fleetOne, c.ShipGroup(gi).Index, 0),