Skip to content

ships.Function.enumerateSlots

github-actions[bot] edited this page Aug 26, 2026 · 73 revisions

@elite-dangerous-almanac/core / ships / enumerateSlots

Function: enumerateSlots()

enumerateSlots(layout): BuildSlot[]

Defined in: src/ships/slots.ts:483

Expand a hull's ShipSlots layout into keyed BuildSlots, in outfitting-panel order: hardpoints, utility mounts, armour, the seven core internals, then the optional internals, then the cargo hatch.

The keys are journal-compatible, so the same key identifies a mount whether the build was assembled from scratch or loaded from a SLEF export — SLEF being the journal's own Loadout event in an envelope, its Slot strings are these.

Parameters

layout

ShipSlots

The hull's slot layout.

Returns

BuildSlot[]

Every mount the hull offers, as BuildSlots.

Remarks

Unrestricted optionals are numbered Slot01_SizeN, Slot02_SizeN, … with no gaps, and hardpoints 1, 2, 3 within each size class. Ten hulls disagree, and no rule derives what they do instead, so a mount on one of them carries its own OptionalSlotSpec.name / HardpointSlotSpec.name and that wins:

Hull What the game names it
Anaconda Slot13_Size2, Slot14_Size1 — no 11 or 12
Type-9 Heavy starts at Slot00_Size8; then jumps Slot08Slot11
Type-10 Defender, Federal Dropship, Vulture a gap before the last mounts
Type-7 Transporter the number 09 twice, and five suffixes misreport the size
Keelback, Asp Scout one suffix misreports the size
Type-8 Transporter SmallHardpoint2 then SmallHardpoint4
Caspian Explorer mediums run 6, 5, 1, 2, 3, 4 — out of order, not just gapped

The Panther Clipper Mk II, Type-11 Prospector and Lynx Highliner also carry explicit names that match the derived keys. The Lynx's Slot02_Size5 follows three PassengerNN mounts because a restricted passenger mount consumes no SlotNN number. A hull that names any mount of a kind names all of them, so a derived key and a name never compete for the same string.

Example

import { getShipSlots } from '@elite-dangerous-almanac/core/ships/ships';
import { enumerateSlots } from '@elite-dangerous-almanac/core/ships/slots';

enumerateSlots(getShipSlots('Anaconda')!).filter((s) => s.kind === 'hardpoint');
// -> [{ key: 'HugeHardpoint1', size: 4, ... }, { key: 'LargeHardpoint1', size: 3, ... }, ...]
enumerateSlots(getShipSlots('Anaconda')!)
    .filter((s) => s.kind === 'optional' && !s.restriction)
    .at(-1)?.key; // -> 'Slot14_Size1', not 'Slot12_Size1'

API

Guides
astro
Classes (1)
ProceduralSystem

Properties

Accessors

Methods

Interfaces (16)
Type Aliases (3)
Variables (11)
Functions (37)
Subpath modules (3)
commodities
Interfaces (1)
Type Aliases (1)
Variables (3)
Functions (3)
equipment
Interfaces (6)
Type Aliases (8)
Variables (3)
Functions (10)
Subpath modules (2)
i18n
Interfaces (1)
Type Aliases (1)
Functions (17)
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
Functions (9)
ships
Classes (3)
BuildMetrics

Methods

LoadoutEditError

Constructors

Properties

Methods

ShipLoadout

Accessors

Methods

Interfaces (125)
Type Aliases (44)
Variables (10)
Functions (85)
Subpath modules (8)

Clone this wiki locally