1
0
Fork 0

[golang] finished implementing procument contracts

This commit is contained in:
Julien Dessaux 2025-02-21 00:58:45 +01:00
parent 40c4a8df15
commit e887213aff
Signed by: adyxax
GPG key ID: F92E51B86E07177E
15 changed files with 252 additions and 56 deletions

View file

@ -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], "-")