feat: moge groups in hyperspace
This commit is contained in:
@@ -47,7 +47,7 @@ type InSpace struct {
|
||||
X float64 `json:"x"`
|
||||
Y float64 `json:"y"`
|
||||
// zero is for Launched status
|
||||
// TODO: calculate range dynamically
|
||||
// TODO: calculate range dynamically -BUT- if affects ShipGroup.State()
|
||||
Range float64 `json:"range"`
|
||||
}
|
||||
|
||||
@@ -154,6 +154,14 @@ func (sg ShipGroup) OnPlanet() (uint, bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func (sg ShipGroup) Coord() (float64, float64, bool) {
|
||||
state := sg.State()
|
||||
if state == StateInSpace || state == StateLaunched {
|
||||
return sg.StateInSpace.X, sg.StateInSpace.Y, true
|
||||
}
|
||||
return 0, 0, false
|
||||
}
|
||||
|
||||
func (sg ShipGroup) Equal(other ShipGroup) bool {
|
||||
return sg.OwnerID == other.OwnerID &&
|
||||
sg.TypeID == other.TypeID &&
|
||||
|
||||
Reference in New Issue
Block a user