1
0
Fork 0

[golang] implement systems and waypoints lookups

This commit is contained in:
Julien Dessaux 2025-02-15 01:22:36 +01:00
parent d97985a694
commit 66466e161f
Signed by: adyxax
GPG key ID: F92E51B86E07177E
10 changed files with 205 additions and 0 deletions

View file

@ -23,6 +23,7 @@ type State int
const (
start_running_contracts_with_the_command_ship = iota
visit_all_shipyards
)
func Run(
@ -54,6 +55,11 @@ func Run(
agent.wg.Add(1)
go agent.autoContracting(&agent.ships[0])
state++
case visit_all_shipyards:
if err := agent.visitAllShipyards(&agent.ships[1]); err != nil {
agent.sendShipError(fmt.Errorf("agent runner returned an error on state %d: %w", state, err), &agent.ships[1])
}
state++
return
default:
agent.sendShipError(fmt.Errorf("agent runner reach an unknown state: %d", state), nil)