DotNet.Commodities.Class.CommodityCatalogue - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

EliteDangerousAlmanac / Commodities / CommodityCatalogue

Class: CommodityCatalogue

Defined in: dotnet/src/EliteDangerousAlmanac/Commodities/CommodityCatalogue.cs:29

The market-commodity registries and the lookups that search them.

Remarks

Frontier splits the goods traded at station commodity markets into two registries: the standard commodities on every market, and the rare commodities each produced at a single station. Every lookup searches All by default, so you do not have to know which registry a good belongs to before you can find it.

The by-key lookups take an optional subset. Passing All, or omitting the argument, answers from an index; every other list is scanned.

The data originates from EDCD FDevIDs, from player-journal observations and from the running game's own commodity registry. See data/commodities/SOURCES.md for provenance and ATTRIBUTIONS.md for credit.

Properties

All

static All: IReadOnlyList<Commodity>

Defined in: dotnet/src/EliteDangerousAlmanac/Commodities/CommodityCatalogue.cs:58

Every commodity: the standard registry, then the rare registry.

Rare

static Rare: IReadOnlyList<Commodity>

Defined in: dotnet/src/EliteDangerousAlmanac/Commodities/CommodityCatalogue.cs:55

Every rare commodity. Every record has Commodity.Rare set to true.

Standard

static Standard: IReadOnlyList<Commodity>

Defined in: dotnet/src/EliteDangerousAlmanac/Commodities/CommodityCatalogue.cs:49

Every standard commodity, in Frontier's registry order. Every record has Commodity.Rare set to false.

Methods

FindByName()

static FindByName(name, commodities?): Commodity?

Defined in: dotnet/src/EliteDangerousAlmanac/Commodities/CommodityCatalogue.cs:85

Finds a commodity by its display name.

Parameters

name

string?

The display name as the market spells it, such as Lavian Brandy. Leading and trailing whitespace and case are ignored; matching is otherwise exact.

commodities

IReadOnlyList<Commodity>? = null

The subset to search. Omit it to search every commodity.

Returns

Commodity?

The commodity, or null when none has that name.

FindBySymbol()

static FindBySymbol(symbol, commodities?): Commodity?

Defined in: dotnet/src/EliteDangerousAlmanac/Commodities/CommodityCatalogue.cs:73

Finds a commodity by its Frontier symbol, the id the market and the player journal report.

Parameters

symbol

string?

The internal symbol, such as Platinum. Leading and trailing whitespace and case are ignored.

commodities

IReadOnlyList<Commodity>? = null

The subset to search. Omit it to search every commodity, which is also the only indexed path.

Returns

Commodity?

The commodity, or null when none has that symbol.

InCategory()

static InCategory(category): IReadOnlyList<Commodity>

Defined in: dotnet/src/EliteDangerousAlmanac/Commodities/CommodityCatalogue.cs:93

Every commodity in one market group, standard and rare, in registry order.

Parameters

category

CommodityCategory

The market group to match.

Returns

IReadOnlyList<Commodity>

The matches, in catalogue order.

InCategory()

static InCategory(category): IReadOnlyList<Commodity>

Defined in: dotnet/src/EliteDangerousAlmanac/Commodities/CommodityCatalogue.cs:112

Every commodity in one market group, named as the game spells it.

Parameters

category

string?

The group name, such as Legal Drugs.

Returns

IReadOnlyList<Commodity>

The matches, or an empty list when no group has that name.

Remarks

The same answer as the CommodityCategory overload, reached from a string — which is what a market payload or a user's dropdown hands you. Leading and trailing whitespace and case are ignored.

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