diff options
author | Julien Dessaux | 2024-05-21 00:26:17 +0200 |
---|---|---|
committer | Julien Dessaux | 2024-05-21 00:26:17 +0200 |
commit | d77558b8def94fd1e1efecc3cfebb7dd3b6d6ae3 (patch) | |
tree | ec1c660af2badb2df4e407d81e16a5a297b4773d /nodejs/lib/systems.ts | |
parent | Fixed pathing function for probes (diff) | |
download | spacetraders-d77558b8def94fd1e1efecc3cfebb7dd3b6d6ae3.tar.gz spacetraders-d77558b8def94fd1e1efecc3cfebb7dd3b6d6ae3.tar.bz2 spacetraders-d77558b8def94fd1e1efecc3cfebb7dd3b6d6ae3.zip |
[node] implement agent automation that visits all shipyards with the starting probe
Diffstat (limited to '')
-rw-r--r-- | nodejs/lib/systems.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nodejs/lib/systems.ts b/nodejs/lib/systems.ts index 6f0a830..f07f92b 100644 --- a/nodejs/lib/systems.ts +++ b/nodejs/lib/systems.ts @@ -13,13 +13,13 @@ import { Waypoint, } from './types.ts' import { - isThereAShipAtThisWaypoint, + is_there_a_ship_at_this_waypoint, systemFromWaypoint, } from './utils.ts'; export async function market(waypoint: Waypoint): Promise<Market> { const data = dbMarkets.getMarketAtWaypoint(waypoint.symbol); - if (data && (data.tradeGoods || !isThereAShipAtThisWaypoint(waypoint))) { return data; } + if (data && (data.tradeGoods || !is_there_a_ship_at_this_waypoint(waypoint))) { return data; } const systemSymbol = systemFromWaypoint(waypoint.symbol); let response = await send<Market>({endpoint: `/systems/${systemSymbol}/waypoints/${waypoint.symbol}/market`}); if (response.error) { @@ -32,7 +32,7 @@ export async function market(waypoint: Waypoint): Promise<Market> { export async function shipyard(waypoint: Waypoint): Promise<Shipyard> { const data = dbShipyards.get(waypoint.symbol); - if (data && (data.ships || !isThereAShipAtThisWaypoint(waypoint))) { return data; } + if (data && (data.ships || !is_there_a_ship_at_this_waypoint(waypoint))) { return data; } const systemSymbol = systemFromWaypoint(waypoint.symbol); const response = await send<Shipyard>({endpoint: `/systems/${systemSymbol}/waypoints/${waypoint.symbol}/shipyard`}); if (response.error) { |