cmd: planet production

This commit is contained in:
Ilia Denisov
2025-10-02 02:05:00 +03:00
parent 8a7e2f57c7
commit 0890bf3009
7 changed files with 160 additions and 19 deletions
+17 -3
View File
@@ -8,8 +8,21 @@ import (
)
func TestShipType(t *testing.T) {
Freighter := game.ShipType{
ShipTypeReport: game.ShipTypeReport{
Name: "Freighter",
Drive: 8,
Armament: 0,
Weapons: 0,
Shields: 2,
Cargo: 10,
},
}
assert.Equal(t, 20., Freighter.EmptyMass())
Gunship := game.ShipType{
ShipTypeReport: game.ShipTypeReport{
Name: "Gunship",
Drive: 4,
Armament: 2,
Weapons: 2,
@@ -17,10 +30,11 @@ func TestShipType(t *testing.T) {
Cargo: 0,
},
}
assert.Equal(t, Gunship.EmptyMass(), 11.)
assert.Equal(t, 11., Gunship.EmptyMass())
Cruiser := game.ShipType{
ShipTypeReport: game.ShipTypeReport{
Name: "Cruiser",
Drive: 15,
Armament: 1,
Weapons: 15,
@@ -28,7 +42,7 @@ func TestShipType(t *testing.T) {
Cargo: 0,
},
}
assert.Equal(t, Cruiser.EmptyMass(), 45.)
assert.Equal(t, 45., Cruiser.EmptyMass())
sg := game.ShipGroup{
Type: Cruiser,
@@ -43,7 +57,7 @@ func TestShipType(t *testing.T) {
sg.UpgradeWeaponsCost(2.0) +
sg.UpgradeShieldsCost(2.0) +
sg.UpgradeCargoCost(2.0)
assert.Equal(t, upgradeCost, 225.)
assert.Equal(t, 225., upgradeCost)
}
func TestCargoCapacity(t *testing.T) {