use crate::internal::*;
use crate::prelude::*;
pub mod gaseous;
pub mod generator;
pub mod icy;
pub mod moon;
pub mod telluric;
pub mod traits;
pub mod types;
pub mod world;
#[derive(Clone, PartialEq, PartialOrd, Debug, SmartDefault, Serialize, Deserialize)]
pub struct CelestialBody {
stub: bool,
#[default("default")]
pub name: Rc<str>,
pub orbit: Option<Orbit>,
pub orbital_point_id: u32,
pub mass: f64,
pub radius: f64,
pub density: f32,
pub gravity: f32,
pub blackbody_temperature: u32,
pub size: CelestialBodySize,
pub details: CelestialBodyDetails,
pub tidal_heating: u32,
}
impl CelestialBody {
pub fn new(
orbit: Option<Orbit>,
orbital_point_id: u32,
name: Rc<str>,
mass: f64,
radius: f64,
density: f32,
gravity: f32,
blackbody_temperature: u32,
tidal_heating: u32,
size: CelestialBodySize,
details: CelestialBodyDetails,
) -> Self {
Self {
stub: false,
orbit,
orbital_point_id,
name,
mass,
radius,
density,
gravity,
blackbody_temperature,
tidal_heating,
size,
details,
}
}
pub fn is_stub(self) -> bool {
self.stub
}
}