refactor: group launched/in_space state
This commit is contained in:
@@ -102,10 +102,7 @@ func TestBreakGroup(t *testing.T) {
|
||||
c, g := newCache()
|
||||
assert.NoError(t, c.CreateShips(Race_0_idx, Race_0_Freighter, R0_Planet_0_num, 13)) // group #1 (0)
|
||||
assert.NoError(t, c.CreateShips(Race_0_idx, Race_0_Gunship, R0_Planet_0_num, 7)) // group #2 (1) - In_Space
|
||||
c.ShipGroup(1).StateInSpace = &game.InSpace{
|
||||
Origin: 1,
|
||||
Range: 1,
|
||||
}
|
||||
c.ShipGroup(1).StateInSpace = &InSpace
|
||||
|
||||
fleet := "R0_Fleet"
|
||||
assert.NoError(t, g.JoinShipGroupToFleet(Race_0.Name, fleet, 1, 0))
|
||||
@@ -178,10 +175,7 @@ func TestTransferGroup(t *testing.T) {
|
||||
assert.NoError(t, c.CreateShips(Race_0_idx, Race_0_Gunship, R0_Planet_0_num, 17)) // group #2 (2) - In_Space
|
||||
assert.NoError(t, g.JoinShipGroupToFleet(Race_0.Name, "R0_Fleet", 2, 0))
|
||||
assert.NotNil(t, c.ShipGroup(2).FleetID)
|
||||
c.ShipGroup(2).StateInSpace = &game.InSpace{
|
||||
Origin: 2,
|
||||
Range: 31.337,
|
||||
}
|
||||
c.ShipGroup(2).StateInSpace = &InSpace
|
||||
c.ShipGroup(2).CargoType = game.CargoMaterial.Ref()
|
||||
c.ShipGroup(2).Load = 1.234
|
||||
|
||||
@@ -271,10 +265,7 @@ func TestLoadCargo(t *testing.T) {
|
||||
|
||||
// 3: idx = 2 / In_Space
|
||||
assert.NoError(t, c.CreateShips(Race_0_idx, Race_0_Freighter, R0_Planet_0_num, 7))
|
||||
c.ShipGroup(2).StateInSpace = &game.InSpace{
|
||||
Origin: 2,
|
||||
Range: 31.337,
|
||||
}
|
||||
c.ShipGroup(2).StateInSpace = &InSpace
|
||||
|
||||
// 4: idx = 3 / loaded with COL
|
||||
assert.NoError(t, c.CreateShips(Race_0_idx, Race_0_Freighter, R0_Planet_0_num, 11))
|
||||
@@ -394,10 +385,7 @@ func TestUnloadCargo(t *testing.T) {
|
||||
|
||||
// 3: idx = 2 / In_Space
|
||||
assert.NoError(t, c.CreateShips(Race_0_idx, Race_0_Freighter, R0_Planet_0_num, 7))
|
||||
c.ShipGroup(2).StateInSpace = &game.InSpace{
|
||||
Origin: 2,
|
||||
Range: 31.337,
|
||||
}
|
||||
c.ShipGroup(2).StateInSpace = &InSpace
|
||||
|
||||
// 4: idx = 3 / loaded with COL
|
||||
assert.NoError(t, c.CreateShips(Race_0_idx, Race_0_Freighter, R0_Planet_0_num, 11))
|
||||
@@ -491,10 +479,7 @@ func TestDisassembleGroup(t *testing.T) {
|
||||
|
||||
// 2: idx = 1 / In_Space
|
||||
assert.NoError(t, c.CreateShips(Race_0_idx, Race_0_Freighter, R0_Planet_0_num, 7))
|
||||
c.ShipGroup(1).StateInSpace = &game.InSpace{
|
||||
Origin: 2,
|
||||
Range: 31.337,
|
||||
}
|
||||
c.ShipGroup(1).StateInSpace = &InSpace
|
||||
|
||||
// 3: idx = 2 / loaded with COL
|
||||
assert.NoError(t, c.CreateShips(Race_0_idx, Race_0_Freighter, R0_Planet_0_num, 10))
|
||||
|
||||
Reference in New Issue
Block a user