refactor: fleet/group AtPlanet

This commit is contained in:
Ilia Denisov
2026-02-05 15:49:51 +02:00
parent e90218368c
commit fef1be577d
7 changed files with 24 additions and 21 deletions
+2 -3
View File
@@ -142,8 +142,7 @@ func (sg ShipGroup) State() ShipGroupState {
}
}
// FIXME: ambigous func, refactor
func (sg ShipGroup) OnPlanet() (uint, bool) {
func (sg ShipGroup) AtPlanet() (uint, bool) {
switch sg.State() {
case StateInOrbit:
return sg.Destination, true
@@ -171,7 +170,7 @@ func (sg ShipGroup) Equal(other ShipGroup) bool {
sg.TechLevel(TechShields) == other.TechLevel(TechShields) &&
sg.TechLevel(TechCargo) == other.TechLevel(TechCargo) &&
sg.CargoType == other.CargoType &&
sg.Load.F()/float64(sg.Number) == other.Load.F()/float64(other.Number) &&
(sg.Load/F(float64(sg.Number))).F() == (other.Load/F(float64(other.Number))).F() &&
sg.State() == other.State()
}