pub mod adjective;
pub mod decorative;
pub mod location;
pub mod major;
pub mod minor;
pub mod query;
use crate::data::stars::{MUTAGEN, StarKey};
use crate::data::types::*;
use crate::i18n::translate_star;
use crate::models::star::Star;
pub(crate) fn make_star(
key: StarKey,
star_type: StarType,
scope: Scope,
palace_index: usize,
yearly_stem: Option<HeavenlyStem>,
lang: Language,
config: &Config,
) -> Star {
let brightness = config.brightness_of(key, palace_index);
let mutagen = yearly_stem.and_then(|stem| {
config
.mutagens_of(stem)
.iter()
.position(|&k| k == key)
.map(|i| MUTAGEN[i])
});
Star {
key,
name: translate_star(key, lang).to_string(),
star_type,
scope,
brightness,
mutagen,
}
}