well, fuck...

This commit is contained in:
Ilia Denisov
2025-09-28 09:17:17 +03:00
parent 66eeefc65d
commit 6510676237
8 changed files with 203 additions and 62 deletions
+28 -20
View File
@@ -9,20 +9,24 @@ import (
func TestShipType(t *testing.T) {
Gunship := game.ShipType{
Drive: 4,
Armament: 2,
Weapons: 2,
Shields: 4,
Cargo: 0,
ShipTypeReport: game.ShipTypeReport{
Drive: 4,
Armament: 2,
Weapons: 2,
Shields: 4,
Cargo: 0,
},
}
assert.Equal(t, Gunship.EmptyMass(), 11.)
Cruiser := game.ShipType{
Drive: 15,
Armament: 1,
Weapons: 15,
Shields: 15,
Cargo: 0,
ShipTypeReport: game.ShipTypeReport{
Drive: 15,
Armament: 1,
Weapons: 15,
Shields: 15,
Cargo: 0,
},
}
assert.Equal(t, Cruiser.EmptyMass(), 45.)
@@ -45,11 +49,13 @@ func TestShipType(t *testing.T) {
func TestCargoCapacity(t *testing.T) {
test := func(cargoSize float64, expectCapacity float64) {
ship := game.ShipType{
Drive: 1,
Armament: 1,
Weapons: 1,
Shields: 1,
Cargo: cargoSize,
ShipTypeReport: game.ShipTypeReport{
Drive: 1,
Armament: 1,
Weapons: 1,
Shields: 1,
Cargo: cargoSize,
},
}
sg := game.ShipGroup{
Type: ship,
@@ -71,11 +77,13 @@ func TestCargoCapacity(t *testing.T) {
func TestBombingPower(t *testing.T) {
Gunship := game.ShipType{
Drive: 60.0,
Armament: 3,
Weapons: 30.0,
Shields: 100.0,
Cargo: 0.0,
ShipTypeReport: game.ShipTypeReport{
Drive: 60.0,
Armament: 3,
Weapons: 30.0,
Shields: 100.0,
Cargo: 0.0,
},
}
sg := game.ShipGroup{
Type: Gunship,