From 5aac233c08567844d6b99afb4d0a1a56725dd6c4 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 5 May 2024 00:08:28 +0200 Subject: [node] fix shortest path to only hop through refueling points --- nodejs/automation/selling.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'nodejs/automation') diff --git a/nodejs/automation/selling.ts b/nodejs/automation/selling.ts index 5dee8f7..b17aad0 100644 --- a/nodejs/automation/selling.ts +++ b/nodejs/automation/selling.ts @@ -3,12 +3,9 @@ import * as libSystems from '../lib/systems.ts'; import { categorizeCargo, sortByDistanceFrom, + whatCanBeTradedAt, } from '../lib/utils.ts'; import { Ship } from '../lib/ships.ts'; -import { - CargoManifest, - CommonThing, -} from '../lib/types.ts'; // example ctx { ship: {XXX}, keep: 'SILVER_ORE' } export async function sell(ship: Ship, good: string): Promise { @@ -54,7 +51,3 @@ export async function sell(ship: Ship, good: string): Promise { throw new Error(`Ship {ship.symbol} has found no importing or exchanging market for its cargo in the system`); } } - -function whatCanBeTradedAt(cargo: CargoManifest, goods: Array): Array { - return goods.filter(g => cargo[g.symbol] !== undefined ); -} -- cgit v1.2.3