use crate::astronomy::planetary_system::PlanetarySystem;
pub mod constants;
pub mod constraints;
pub mod error;
use error::Error;
#[derive(Clone, Debug, PartialEq)]
pub struct DistantBinaryStar {
pub primary: PlanetarySystem,
pub secondary: PlanetarySystem,
}
impl DistantBinaryStar {
#[named]
pub fn check_habitable(&self) -> Result<(), Error> {
trace_enter!();
self.primary.check_habitable()?;
self.secondary.check_habitable()?;
let result = Ok(());
trace_var!(result);
trace_exit!();
result
}
#[named]
pub fn is_habitable(&self) -> bool {
trace_enter!();
let result = match self.check_habitable() {
Ok(()) => true,
Err(_) => false,
};
trace_var!(result);
trace_exit!();
result
}
#[named]
pub fn get_stellar_mass(&self) -> f64 {
trace_enter!();
let result = self.primary.get_stellar_mass() + self.secondary.get_stellar_mass();
trace_var!(result);
trace_exit!();
result
}
#[named]
pub fn get_stellar_count(&self) -> u8 {
trace_enter!();
let result = self.primary.get_stellar_count() + self.secondary.get_stellar_count();
trace_var!(result);
trace_exit!();
result
}
}