summaryrefslogtreecommitdiff
path: root/nodejs/automation
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--nodejs/automation/selling.ts9
1 files changed, 1 insertions, 8 deletions
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<Ship> {
@@ -54,7 +51,3 @@ export async function sell(ship: Ship, good: string): Promise<Ship> {
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<CommonThing>): Array<CommonThing> {
- return goods.filter(g => cargo[g.symbol] !== undefined );
-}