refactor: planet owner
This commit is contained in:
@@ -16,24 +16,16 @@ func TestPlanetProduction(t *testing.T) {
|
||||
|
||||
func TestProduceIndustry(t *testing.T) {
|
||||
HW := &game.Planet{
|
||||
PlanetReport: game.PlanetReport{
|
||||
UninhabitedPlanet: game.UninhabitedPlanet{
|
||||
Size: 1000,
|
||||
Resources: 10,
|
||||
},
|
||||
Population: 1000,
|
||||
Industry: 1000,
|
||||
},
|
||||
Size: 1000,
|
||||
Resources: 10,
|
||||
Population: 1000,
|
||||
Industry: 1000,
|
||||
}
|
||||
DW := &game.Planet{
|
||||
PlanetReport: game.PlanetReport{
|
||||
UninhabitedPlanet: game.UninhabitedPlanet{
|
||||
Size: 500,
|
||||
Resources: 10,
|
||||
},
|
||||
Population: 500,
|
||||
Industry: 500,
|
||||
},
|
||||
Size: 500,
|
||||
Resources: 10,
|
||||
Population: 500,
|
||||
Industry: 500,
|
||||
}
|
||||
HW.ProduceIndustry()
|
||||
assert.InDelta(t, 196.078, HW.Capital.F(), 0.0005)
|
||||
@@ -58,14 +50,10 @@ func TestProduceIndustry(t *testing.T) {
|
||||
|
||||
func TestProduceMaterial(t *testing.T) {
|
||||
HW := &game.Planet{
|
||||
PlanetReport: game.PlanetReport{
|
||||
UninhabitedPlanet: game.UninhabitedPlanet{
|
||||
Size: 1000,
|
||||
Resources: 10,
|
||||
},
|
||||
Population: 1000,
|
||||
Industry: 1000,
|
||||
},
|
||||
Size: 1000,
|
||||
Resources: 10,
|
||||
Population: 1000,
|
||||
Industry: 1000,
|
||||
}
|
||||
assert.Equal(t, 0., HW.Material.F())
|
||||
|
||||
@@ -84,14 +72,10 @@ func TestProduceMaterial(t *testing.T) {
|
||||
|
||||
func TestUnpackCapital(t *testing.T) {
|
||||
HW := &game.Planet{
|
||||
PlanetReport: game.PlanetReport{
|
||||
UninhabitedPlanet: game.UninhabitedPlanet{
|
||||
Size: 1000,
|
||||
Resources: 10,
|
||||
},
|
||||
Population: 1000,
|
||||
Industry: 1000,
|
||||
},
|
||||
Size: 1000,
|
||||
Resources: 10,
|
||||
Population: 1000,
|
||||
Industry: 1000,
|
||||
}
|
||||
assert.Equal(t, 0., HW.Capital.F())
|
||||
|
||||
@@ -119,14 +103,10 @@ func TestUnpackCapital(t *testing.T) {
|
||||
|
||||
func TestUnpackColonists(t *testing.T) {
|
||||
HW := &game.Planet{
|
||||
PlanetReport: game.PlanetReport{
|
||||
UninhabitedPlanet: game.UninhabitedPlanet{
|
||||
Size: 1000,
|
||||
Resources: 10,
|
||||
},
|
||||
Population: 1000,
|
||||
Industry: 1000,
|
||||
},
|
||||
Size: 1000,
|
||||
Resources: 10,
|
||||
Population: 1000,
|
||||
Industry: 1000,
|
||||
}
|
||||
assert.Equal(t, 0., HW.Colonists.F())
|
||||
|
||||
@@ -152,14 +132,10 @@ func TestUnpackColonists(t *testing.T) {
|
||||
|
||||
func TestProducePopulation(t *testing.T) {
|
||||
HW := &game.Planet{
|
||||
PlanetReport: game.PlanetReport{
|
||||
UninhabitedPlanet: game.UninhabitedPlanet{
|
||||
Size: 1000,
|
||||
Resources: 10,
|
||||
},
|
||||
Population: 500,
|
||||
Industry: 1000,
|
||||
},
|
||||
Size: 1000,
|
||||
Resources: 10,
|
||||
Population: 500,
|
||||
Industry: 1000,
|
||||
}
|
||||
assert.Equal(t, 500., HW.Population.F())
|
||||
assert.Equal(t, 0., HW.Colonists.F())
|
||||
|
||||
Reference in New Issue
Block a user