use crate::core::model::calendar::BirthContext;
use crate::core::model::profile::MethodProfile;
use crate::core::placement::natal::life_body::{LunarDay, LunarMonth};
use lunar_lite::{EarthlyBranch, HeavenlyStem};
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct NatalChartInput {
birth_context: BirthContext,
method_profile: MethodProfile,
lunar_month: LunarMonth,
birth_year_stem: HeavenlyStem,
birth_year_branch: EarthlyBranch,
}
impl NatalChartInput {
pub const fn new(
birth_context: BirthContext,
method_profile: MethodProfile,
lunar_month: LunarMonth,
birth_year_stem: HeavenlyStem,
birth_year_branch: EarthlyBranch,
) -> Self {
Self {
birth_context,
method_profile,
lunar_month,
birth_year_stem,
birth_year_branch,
}
}
pub const fn birth_context(&self) -> &BirthContext {
&self.birth_context
}
pub const fn method_profile(&self) -> &MethodProfile {
&self.method_profile
}
pub const fn lunar_month(&self) -> LunarMonth {
self.lunar_month
}
pub const fn birth_year_stem(&self) -> HeavenlyStem {
self.birth_year_stem
}
pub const fn birth_year_branch(&self) -> EarthlyBranch {
self.birth_year_branch
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct NatalChartWithMajorStarsInput {
birth_context: BirthContext,
method_profile: MethodProfile,
lunar_month: LunarMonth,
lunar_day: LunarDay,
birth_year_stem: HeavenlyStem,
birth_year_branch: EarthlyBranch,
}
impl NatalChartWithMajorStarsInput {
pub const fn new(
birth_context: BirthContext,
method_profile: MethodProfile,
lunar_month: LunarMonth,
lunar_day: LunarDay,
birth_year_stem: HeavenlyStem,
birth_year_branch: EarthlyBranch,
) -> Self {
Self {
birth_context,
method_profile,
lunar_month,
lunar_day,
birth_year_stem,
birth_year_branch,
}
}
pub const fn birth_context(&self) -> &BirthContext {
&self.birth_context
}
pub const fn method_profile(&self) -> &MethodProfile {
&self.method_profile
}
pub const fn lunar_month(&self) -> LunarMonth {
self.lunar_month
}
pub const fn lunar_day(&self) -> LunarDay {
self.lunar_day
}
pub const fn birth_year_stem(&self) -> HeavenlyStem {
self.birth_year_stem
}
pub const fn birth_year_branch(&self) -> EarthlyBranch {
self.birth_year_branch
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct NatalChartWithSupportedStarsInput {
birth_context: BirthContext,
method_profile: MethodProfile,
lunar_month: LunarMonth,
lunar_day: LunarDay,
daily_star_offset: u8,
birth_year_stem: HeavenlyStem,
birth_year_branch: EarthlyBranch,
}
impl NatalChartWithSupportedStarsInput {
pub const fn new(
birth_context: BirthContext,
method_profile: MethodProfile,
lunar_month: LunarMonth,
lunar_day: LunarDay,
birth_year_stem: HeavenlyStem,
birth_year_branch: EarthlyBranch,
) -> Self {
Self::new_with_daily_star_offset(
birth_context,
method_profile,
lunar_month,
lunar_day,
lunar_day.value() - 1,
birth_year_stem,
birth_year_branch,
)
}
#[allow(clippy::too_many_arguments)]
pub const fn new_with_daily_star_offset(
birth_context: BirthContext,
method_profile: MethodProfile,
lunar_month: LunarMonth,
lunar_day: LunarDay,
daily_star_offset: u8,
birth_year_stem: HeavenlyStem,
birth_year_branch: EarthlyBranch,
) -> Self {
Self {
birth_context,
method_profile,
lunar_month,
lunar_day,
daily_star_offset,
birth_year_stem,
birth_year_branch,
}
}
pub const fn birth_context(&self) -> &BirthContext {
&self.birth_context
}
pub const fn method_profile(&self) -> &MethodProfile {
&self.method_profile
}
pub const fn lunar_month(&self) -> LunarMonth {
self.lunar_month
}
pub const fn lunar_day(&self) -> LunarDay {
self.lunar_day
}
pub const fn daily_star_offset(&self) -> u8 {
self.daily_star_offset
}
pub const fn birth_year_stem(&self) -> HeavenlyStem {
self.birth_year_stem
}
pub const fn birth_year_branch(&self) -> EarthlyBranch {
self.birth_year_branch
}
}