DotNet.Ships.Class.SourcePurchase - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
EliteDangerousAlmanac / Ships / SourcePurchase
Defined in: dotnet/src/EliteDangerousAlmanac/Ships/SourcePurchase.cs:58
Reads the credit figures a captured loadout carries.
No discount is inferred. One capture can mix purchases from several stations, omit module values, or state a total that differs from its priced parts. These queries keep those facts visible instead of inventing one misleading percentage.
staticFindModuleValue(record,slotKey):SourceModuleValue?
Defined in: dotnet/src/EliteDangerousAlmanac/Ships/SourcePurchase.cs:121
Finds the captured purchase entry for one mount.
The record to read.
string?
The mount key, such as PowerPlant. An exact spelling wins; otherwise the match folds case and ignores the surrounding whitespace, as every identifier lookup in this library does, so a journal key and a lower-cased SLEF key both resolve.
The entry, or null when the source priced no module in that mount. A miss never means the module was free.
ArgumentNullException
record is null.
staticFromLoadout(loadout):SourcePurchaseRecord?
Defined in: dotnet/src/EliteDangerousAlmanac/Ships/SourcePurchase.cs:71
Reads the purchase figures off a journal Loadout event.
The event to read. No object in it is kept by reference.
The record, or null when the source states no credit figure at all. A record of nothing but absent figures would read as a source that priced the build at nothing.
A malformed event that repeats an exactly spelled mount keeps the last entry.
ArgumentNullException
loadout is null.
staticSumModuleValues(record):double
Defined in: dotnet/src/EliteDangerousAlmanac/Ships/SourcePurchase.cs:150
Adds up every per-mount price the source stated.
The record whose individually priced entries to add.
double
The stated total in credits, or zero when no module was individually priced.
This does not replace SourcePurchaseRecord.ModulesValue. A capture may omit individual prices or state an inconsistent total, and comparing the two figures is useful precisely because this one hides no such disagreement.
ArgumentNullException
record is null.