feat: bomb planets

This commit is contained in:
Ilia Denisov
2026-01-19 23:08:57 +02:00
parent bd9db26ef4
commit 40b2cb27f6
13 changed files with 440 additions and 22 deletions
+6 -4
View File
@@ -6,6 +6,7 @@ import (
"github.com/google/uuid"
"github.com/iliadenisov/galaxy/internal/model/game"
"github.com/iliadenisov/galaxy/internal/number"
"github.com/stretchr/testify/assert"
)
@@ -104,8 +105,9 @@ func TestSpeed(t *testing.T) {
}
func TestBombingPower(t *testing.T) {
Gunship := game.ShipType{
BattleStation := game.ShipType{
ShipTypeReport: game.ShipTypeReport{
Name: "Battle_Station",
Drive: 60.0,
Armament: 3,
Weapons: 30.0,
@@ -122,9 +124,9 @@ func TestBombingPower(t *testing.T) {
game.TechCargo: 1.0,
},
}
expectedBombingPower := 139.295
result := sg.BombingPower(&Gunship)
assert.Equal(t, expectedBombingPower, result)
assert.Equal(t, 139.295, number.Fixed3(sg.BombingPower(&BattleStation)))
sg.Number = 2
assert.Equal(t, 278.590, number.Fixed3(sg.BombingPower(&BattleStation)))
}
func TestDriveEffective(t *testing.T) {