mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-11 18:26:04 +00:00
* feat: Automatically set connection EOL status and ship size type when linking/updating signatures
14 lines
532 B
TypeScript
14 lines
532 B
TypeScript
import { SHIP_MASSES_SIZE } from '../components/map/constants';
|
|
import { ShipSizeStatus } from '../types/connection';
|
|
import { WormholeDataRaw } from '../types/wormholes';
|
|
|
|
export const getWhSize = (whDatas: WormholeDataRaw[], whType: string): ShipSizeStatus | null => {
|
|
if (whType === 'K162' || whType == null) return null;
|
|
|
|
const wormholeData = whDatas.find(wh => wh.name === whType);
|
|
|
|
if (!wormholeData?.max_mass_per_jump) return null;
|
|
|
|
return SHIP_MASSES_SIZE[wormholeData.max_mass_per_jump] ?? ShipSizeStatus.large;
|
|
};
|