DotNet.Ships.Class.BuildSlots - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

EliteDangerousAlmanac / Ships / BuildSlots

Class: BuildSlots

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/BuildSlots.cs:25

The slot model for a ship build: it expands a hull's layout into keyed mounts, and it reads a journal slot name back into the same shape.

Remarks

A hull offers a fixed set of mounts: seven core internals, a handful of weapon hardpoints, some tiny utility mounts, and a column of optional internals. Some mounts are restricted to one family of modules.

This class holds no data. Enumerate takes a hull's ShipSlots layout and gives every mount a stable, journal-compatible key, so a build assembled from scratch and a build read from a journal export speak one vocabulary.

Methods

Enumerate()

static Enumerate(layout): IReadOnlyList<BuildSlot>

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/BuildSlots.cs:102

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

Parameters

layout

ShipSlots

The hull's slot layout.

Returns

IReadOnlyList<BuildSlot>

Every mount the hull offers.

Remarks

Unrestricted optionals are numbered Slot01_SizeN, Slot02_SizeN and so on with no gaps, and hardpoints run 1, 2, 3 within each size class. Some hulls disagree and no rule derives what they do instead, so a mount on one of them carries its own name and that name wins: the Anaconda's Slot13_Size2 and Slot14_Size1 with no 11 or 12, the Type-9 Heavy starting at Slot00_Size8, the Type-8 Transporter skipping SmallHardpoint3, and the Caspian Explorer's mediums running 6, 5, 1, 2, 3, 4.

A restricted optional takes a name numbered within its own restriction and consumes no SlotNN number. A hull that names any mount of a kind names all of them, so a derived key and a stored name never compete for the same string.

Exceptions

ArgumentNullException

layout is null.

ParseName()

static ParseName(slot): ParsedSlot?

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/BuildSlots.cs:201

Reads a journal slot name into a classification.

Parameters

slot

string?

The journal slot name, such as FrameShiftDrive, MediumHardpoint2, Slot03_Size5 or LargeMiningHardpoint1.

Returns

ParsedSlot?

The classification, or null when the name is not a slot this library knows. An absent name is a miss, answered the way an unknown key is.

Remarks

Every restricted mount has a journal name of its own, so the restriction comes off the name and needs no hull layout. The size still may: Cargo01 says only that the mount takes cargo, and the hull's layout carries how big it is.

Casing is not significant. Frontier writes FrameShiftDrive, but a journal export may lower-case every slot key, and both name the same mount.

A _SizeN suffix is what the name says, not what the mount is. On some hulls the game's own key disagrees with the mount it names — the Keelback's Slot03_Size3 is a size-4 mount. To size a mount, find it in the hull's layout rather than trusting the number this returns.

⚠️ **GitHub.com Fallback** ⚠️