use crate::rules::ability_scores::AbilityScore; use lazy_static::lazy_static; use serde::Deserialize; use serde_yaml; use std::collections::HashMap; use std::string::String; #[derive(Deserialize)] pub struct Race { pub name: String, pub ability_score_modifiers: HashMap, pub npc_ability_score_modifiers: HashMap, } lazy_static! { pub static ref RACES: HashMap = load_races(); } // TODO: Is this actually needed? Is there a real race condition this is avoiding? fn load_races() -> HashMap { let yaml_data = include_str!("../data/rules/races.yaml"); serde_yaml::from_str(yaml_data).expect("Failed to parse races YAML") }