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

EliteDangerousAlmanac / Ships / ModuleStats

Class: ModuleStats

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:19

The sparse numeric stats one outfitting module carries.

Remarks

No module family uses every stat, so this holds only the ones a record states. Reading a stat a module does not carry answers null rather than a default, which is what tells a calculation the module is not of the kind it wants.

The collection is immutable. With answers a new collection, which is how engineering builds a fitted module's effective stats without changing the catalogue record behind it.

Fields

Empty

static readonly Empty: ModuleStats

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:22

A module that states no stats at all.

Properties

Count

Count: int

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:29

How many stats this module states.

Entries

Entries: IEnumerable<KeyValuePair<ModuleStat, double>>

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:79

The stats the module states, in no particular order.

Remarks

The dictionary behind the collection is never handed out. A caller that reaches the stats of a catalogue module would otherwise be able to write to the record every other caller in the process reads.

Keys

Keys: IEnumerable<ModuleStat>

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:88

The stats the module states, by key.

Indexers

this[]

this[ModuleStat stat]: double?

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:34

Reads one stat.

Parameters

stat

ModuleStat

The stat to read.

Methods

Equals()

Equals(other): bool

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:97

Parameters

other

ModuleStats?

Returns

bool

Equals()

override Equals(obj): bool

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:112

Parameters

obj

object?

Returns

bool

From()

static From(values): ModuleStats

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:39

Builds a collection from the stats a caller already holds.

Parameters

values

IEnumerable<KeyValuePair<ModuleStat, double>>?

The stats to hold. An absent collection makes an empty one.

Returns

ModuleStats

The collection.

GetHashCode()

override GetHashCode(): int

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:115

Returns

int

Has()

Has(stat): bool

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:50

Whether the module states a stat.

Parameters

stat

ModuleStat

The stat to look for.

Returns

bool

true when the module carries it.

With()

With(stat, value): ModuleStats

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:56

The same stats with one value set or replaced.

Parameters

stat

ModuleStat

The stat to write.

value

double

The value it takes.

Returns

ModuleStats

A new collection. This one is unchanged.

Without()

Without(stat): ModuleStats

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/ModuleStats.cs:65

The same stats with one value removed.

Parameters

stat

ModuleStat

The stat to drop.

Returns

ModuleStats

A new collection, or this one when the stat was already absent.

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