astro.Interface.BodyParent - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / astro / BodyParent
Defined in: src/astro/body-scan.ts:34
One step up a body's parent chain, as one entry of BodyScanEvent.Parents.
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.
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'
readonlyoptionalNull?:number
Defined in: src/astro/body-scan.ts:42
BodyID of the barycentre this body orbits. A point, not a scannable body.
readonlyoptionalPlanet?:number
Defined in: src/astro/body-scan.ts:38
BodyID of the planet this body orbits — the body is a moon of it.
readonlyoptionalRing?:number
Defined in: src/astro/body-scan.ts:40
BodyID of the ring this body sits in — written for a belt cluster.
readonlyoptionalStar?:number
Defined in: src/astro/body-scan.ts:36
BodyID of the star this body orbits.