refactor: group launched/in_space state
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user