astro.Interface.BodyParent - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

@elite-dangerous-almanac/core / astro / BodyParent

Interface: BodyParent

Defined in: src/astro/body-scan.ts:34

One step up a body's parent chain, as one entry of BodyScanEvent.Parents.

Remarks

Exactly one key is present, and its value is that parent's BodyScanEvent.BodyID — so a moon orbiting a planet reads { Planet: 4 }. The four keys are the four kinds of thing a body can orbit; Null is a barycentre, which is a point rather than a body and has no scan of its own.

Example

import type { BodyParent } from '@elite-dangerous-almanac/core/astro';

// A moon of the second planet, which orbits the main star.
const parents: readonly BodyParent[] = [{ Planet: 4 }, { Star: 0 }];

Object.keys(parents[0] ?? {})[0]; // -> 'Planet'

Properties

Null?

readonly optional Null?: number

Defined in: src/astro/body-scan.ts:42

BodyID of the barycentre this body orbits. A point, not a scannable body.


Planet?

readonly optional Planet?: number

Defined in: src/astro/body-scan.ts:38

BodyID of the planet this body orbits — the body is a moon of it.


Ring?

readonly optional Ring?: number

Defined in: src/astro/body-scan.ts:40

BodyID of the ring this body sits in — written for a belt cluster.


Star?

readonly optional Star?: number

Defined in: src/astro/body-scan.ts:36

BodyID of the star this body orbits.

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