DotNet.Equipment.Class.PersonalWeaponCatalogue - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

EliteDangerousAlmanac / Equipment / PersonalWeaponCatalogue

Class: PersonalWeaponCatalogue

Defined in: dotnet/src/EliteDangerousAlmanac/Equipment/PersonalWeaponCatalogue.cs:21

The personal-weapon catalogue, its lookups, and what a weapon deals.

Remarks

Every weapon carries all five grades, and a grade changes the damage one projectile deals and the modification slots the weapon has. Every other stat belongs to the weapon.

The catalogue loads from its shared data file on first use. Every record is immutable, so one caller cannot change another caller's answers.

Properties

All

static All: IReadOnlyList<PersonalWeapon>

Defined in: dotnet/src/EliteDangerousAlmanac/Equipment/PersonalWeaponCatalogue.cs:32

Every personal weapon Pioneer Supplies sells.

Methods

FindByName()

static FindByName(name): PersonalWeapon?

Defined in: dotnet/src/EliteDangerousAlmanac/Equipment/PersonalWeaponCatalogue.cs:45

Finds a weapon by its display name.

Parameters

name

string?

The display name, such as Karma P-15.

Returns

PersonalWeapon?

The weapon, or null for a name no weapon carries.

Remarks

Case and surrounding whitespace are ignored. An absent name is a miss.

FindBySymbol()

static FindBySymbol(symbol): PersonalWeapon?

Defined in: dotnet/src/EliteDangerousAlmanac/Equipment/PersonalWeaponCatalogue.cs:38

Finds a weapon by its item symbol.

Parameters

symbol

string?

The symbol, such as wpn_s_pistol_kinetic_sauto.

Returns

PersonalWeapon?

The weapon, or null for a symbol no weapon carries.

Remarks

Case and surrounding whitespace are ignored. An absent symbol is a miss.

Grade()

static Grade(weapon, grade): PersonalWeaponGrade?

Defined in: dotnet/src/EliteDangerousAlmanac/Equipment/PersonalWeaponCatalogue.cs:54

Reads one weapon's stats at one grade.

Parameters

weapon

PersonalWeapon

The weapon.

grade

int

The grade, from one through five.

Returns

PersonalWeaponGrade?

The grade record, or null where the weapon has no such grade.

Exceptions

ArgumentNullException

The weapon is absent.

ArgumentOutOfRangeException

The grade is not one through five.

Metrics()

static Metrics(weapon, grade, modifiers?, reloadSpeed?): PersonalWeaponMetrics?

Defined in: dotnet/src/EliteDangerousAlmanac/Equipment/PersonalWeaponCatalogue.cs:82

Computes what one weapon deals at one grade.

Parameters

weapon

PersonalWeapon

The weapon.

grade

int

The grade, from one through five.

modifiers

IReadOnlyList<PersonalModifier>? = null

The stat changes the fitted modifications make. A change naming a stat this calculation does not read is passed over.

reloadSpeed

bool = false

Whether the reload-speed modification is fitted, which is what decides between the two reload times the weapon publishes.

Returns

PersonalWeaponMetrics?

The figures, or null where the weapon has no such grade.

Remarks

The magazine is held to whole rounds, the way a ship weapon's clip is, so a hand-built fraction cannot reach the reload cycle and give the two domains different answers.

Exceptions

ArgumentNullException

The weapon is absent.

ArgumentOutOfRangeException

The grade is not one through five.

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