summaryrefslogtreecommitdiffstats
path: root/src/solar_system/body.rs
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-05-12 19:01:27 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-05-12 19:01:27 -0400
commita0a3b3974cab754c10a1517d82762b99482970ce (patch)
tree8aeb0ca1e007bacecc8e12a263bd5aa321b8f69a /src/solar_system/body.rs
parent7f63ec5c10eb7e8dd4edaabd1a6a437328911d39 (diff)
downloadsystemic4x-main.tar.gz
systemic4x-main.tar.bz2
systemic4x-main.zip
update packages to latest versionsHEADmain
Diffstat (limited to 'src/solar_system/body.rs')
-rw-r--r--src/solar_system/body.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/solar_system/body.rs b/src/solar_system/body.rs
index 3e61486..f3aef8c 100644
--- a/src/solar_system/body.rs
+++ b/src/solar_system/body.rs
@@ -9,6 +9,8 @@ pub const BODY_TICK_DURATION: Second = timeman::DAY;
pub struct OrbitalBody
{
id: BodyId,
+ system: SystemId,
+
name: String,
mass: Kilograms,
radius: Kilometers,
@@ -34,10 +36,12 @@ impl OrbitalBody
pub fn new_from_record(
id: BodyId,
+ system: SystemId,
record: CSVOrbitalBody)
-> Self {
Self {
- id: id,
+ id,
+ system,
name: record.name,
mass: record.mass,
radius: record.radius,
@@ -45,6 +49,7 @@ impl OrbitalBody
orbit: match record.orbits {
Some(parent) => Some(StaticOrbit::new(
parent,
+ system,
record.eccentricity,
record.inclination,
record.long_asc_node,
@@ -59,6 +64,7 @@ impl OrbitalBody
}
pub fn id(&self) -> BodyId { self.id }
+ pub fn system(&self) -> SystemId { self.system }
pub fn name(&self) -> &String { &self.name }
pub fn radius(&self) -> f32 { self.radius as f32 }
pub fn mass(&self) -> Kilograms { self.mass }