Skip to content

ships.Function.sumMaterials

github-actions[bot] edited this page Aug 26, 2026 · 73 revisions

@elite-dangerous-almanac/core / ships / sumMaterials

Function: sumMaterials()

sumMaterials(...lists): EngineeringMaterial[]

Defined in: src/ships/engineering.ts:500

Combine several material lists into one, summing the counts of any material that appears in more than one list (matched by symbol, case-insensitively). Use it to fold a blueprint's cost together with an experimental effect's — the two data modules stay decoupled, so pass in whichever lists you have:

Parameters

lists

...readonly readonly EngineeringMaterial[][]

The material lists to merge; each may be empty.

Returns

EngineeringMaterial[]

One entry per distinct material, in first-seen order, with summed counts.

Example

import { getBlueprintCost } from '@elite-dangerous-almanac/core/ships/blueprint-costs';
import { sumMaterials } from '@elite-dangerous-almanac/core/ships/engineering';
import { getExperimentalEffectCost } from '@elite-dangerous-almanac/core/ships/experimental-effect-costs';

sumMaterials(
  getBlueprintCost('FSD_LongRange', 5)!.materials,
  getExperimentalEffectCost('special_fsd_heavy')!,
);

API

Guides
astro
Classes (1)
ProceduralSystem

Properties

Accessors

Methods

Interfaces (16)
Type Aliases (3)
Variables (11)
Functions (37)
Subpath modules (3)
commodities
Interfaces (1)
Type Aliases (1)
Variables (3)
Functions (3)
equipment
Interfaces (6)
Type Aliases (8)
Variables (3)
Functions (10)
Subpath modules (2)
i18n
Interfaces (1)
Type Aliases (1)
Functions (17)
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
Functions (9)
ships
Classes (3)
BuildMetrics

Methods

LoadoutEditError

Constructors

Properties

Methods

ShipLoadout

Accessors

Methods

Interfaces (125)
Type Aliases (44)
Variables (10)
Functions (85)
Subpath modules (8)

Clone this wiki locally