[golang] finished implementing procument contracts
This commit is contained in:
parent
40c4a8df15
commit
e887213aff
15 changed files with 252 additions and 56 deletions
|
@ -1,6 +1,19 @@
|
|||
package api
|
||||
|
||||
import "strings"
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"git.adyxax.org/adyxax/spacetraders/golang/pkg/model"
|
||||
)
|
||||
|
||||
func isThereAShipDockerAtWaypoint(symbol string, ships []model.Ship) bool {
|
||||
for _, ship := range ships {
|
||||
if ship.Nav.WaypointSymbol == symbol && ship.Nav.Status == "DOCKED" {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func WaypointSymbolToSystemSymbol(symbol string) string {
|
||||
return strings.Join(strings.Split(symbol, "-")[:2], "-")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue