DotNet.Astronomy.Class.SystemName - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

EliteDangerousAlmanac / Astronomy / SystemName

Class: SystemName

Defined in: dotnet/src/EliteDangerousAlmanac/Astronomy/SystemName.cs:50

The written form of a procedural system name.

Remarks

A procedural system name reads as Region LL-L m[N1-]N2, as in Synuefe EN-H d11-96 or Blae Eock KC-C d0. The region is the sector name, procedural or hand-written. The three letters and the first index state the boxel inside that region, the mass code states how large the boxel is, and the last index numbers the system inside it. The game leaves the first index and its hyphen out where it is zero.

This class reads and writes the text alone. SystemAddress holds the packed form the game identifies a system by.

Methods

Canonicalize()

static Canonicalize(name): string?

Defined in: dotnet/src/EliteDangerousAlmanac/Astronomy/SystemName.cs:201

Writes a system name in the game's own casing.

Parameters

name

string?

The name in any casing, with any surrounding whitespace.

Returns

string?

The name as the game writes it, or null where it is not a system name.

Remarks

A procedural region is re-cased by reading it through the grid, and a region the game names by hand by looking it up. A region neither answers is left as written, so reading a name stays apart from addressing one.

Format()

static Format(parts): string

Defined in: dotnet/src/EliteDangerousAlmanac/Astronomy/SystemName.cs:167

Writes parts back out as a system name.

Parameters

parts

SystemNameParts

The parts to write.

Returns

string

The name, such as Synuefe EN-H d11-96.

Remarks

The first index and its hyphen are left out where the index is zero, which is what the game does. The region is written as it is held, so a name read in lower case keeps its own region casing.

Exceptions

ArgumentNullException

The parts are absent.

ArgumentOutOfRangeException

A letter is outside zero through 25, or the size class is outside zero through seven.

IsProcedural()

static IsProcedural(name, requireProceduralRegion?): bool

Defined in: dotnet/src/EliteDangerousAlmanac/Astronomy/SystemName.cs:223

Reads whether a name is a well-formed procedural system name.

Parameters

name

string?

The name in any casing, with any surrounding whitespace.

requireProceduralRegion

bool = false

Whether the region must itself be a procedural sector. Where it is true, a system inside a region the game names by hand, such as Pleiades Sector HR-W d1-79, is not one.

Returns

bool

true where the name reads as a procedural system name. A system the game names outright, such as Sol, is not one. An absent name is not one either.

Parse()

static Parse(name): SystemNameParts?

Defined in: dotnet/src/EliteDangerousAlmanac/Astronomy/SystemName.cs:99

Reads a procedural system name into its parts.

Parameters

name

string?

The name in any casing, with any surrounding whitespace.

Returns

SystemNameParts?

The parts, or null where the name is not a procedural system name. An absent name is a miss, so a caller hands over a field an import may not carry.

Remarks

A region name carries digits of its own, as Col 285 Sector does, so the reading walks the ending backwards. The letters and the mass code come out as counts, and therefore write back in the game's own casing. The region comes out as written; Canonicalize re-cases that too.

ToBoxelCode()

static ToBoxelCode(l1, l2, l3, n1): int

Defined in: dotnet/src/EliteDangerousAlmanac/Astronomy/SystemName.cs:68

Packs a boxel's letters and index into one base-26 code.

Parameters

l1

int

The first letter, zero through 25.

l2

int

The second letter, zero through 25.

l3

int

The third letter, zero through 25.

n1

int

The number after the letters.

Returns

int

The packed code.

Exceptions

ArgumentOutOfRangeException

A letter is outside zero through 25, or the number is too large to pack exactly.

ToBoxelLetters()

static ToBoxelLetters(boxelCode): BoxelLetters

Defined in: dotnet/src/EliteDangerousAlmanac/Astronomy/SystemName.cs:77

Takes the letters and the index back out of one boxel code.

Parameters

boxelCode

int

The packed code, as the address decoder answers.

Returns

BoxelLetters

The three letters and the number after them.

Exceptions

ArgumentOutOfRangeException

The code is not one ToBoxelCode answers.

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