49 lines
1.4 KiB
Rust
49 lines
1.4 KiB
Rust
use crate::dynamic_data::libraries::battle_stat_calculator::BattleStatCalculator;
|
|
use crate::dynamic_data::libraries::script_resolver::ScriptCategory;
|
|
use crate::dynamic_data::script_handling::item_script::ItemScript;
|
|
use crate::dynamic_data::script_handling::script::Script;
|
|
use crate::static_data::items::item::Item;
|
|
use crate::static_data::libraries::static_data::StaticData;
|
|
use crate::{PkmnResult, StringKey};
|
|
|
|
#[derive(Debug)]
|
|
pub struct DynamicLibrary<'a> {
|
|
static_data: StaticData<'a>,
|
|
stat_calculator: BattleStatCalculator,
|
|
}
|
|
|
|
impl<'a> DynamicLibrary<'a> {
|
|
pub fn static_data(&self) -> &StaticData<'a> {
|
|
&self.static_data
|
|
}
|
|
pub fn stat_calculator(&self) -> &BattleStatCalculator {
|
|
&self.stat_calculator
|
|
}
|
|
|
|
pub fn load_script(
|
|
&self,
|
|
_category: ScriptCategory,
|
|
_key: &StringKey,
|
|
) -> PkmnResult<Option<Box<dyn Script>>> {
|
|
todo!()
|
|
}
|
|
|
|
pub fn load_item_script(&self, _key: &Item) -> PkmnResult<Option<Box<dyn ItemScript>>> {
|
|
todo!()
|
|
}
|
|
}
|
|
|
|
#[cfg(test)]
|
|
pub mod test {
|
|
use crate::dynamic_data::libraries::battle_stat_calculator::BattleStatCalculator;
|
|
use crate::dynamic_data::libraries::dynamic_library::DynamicLibrary;
|
|
use crate::static_data::libraries::static_data;
|
|
|
|
pub fn build<'a>() -> DynamicLibrary<'a> {
|
|
DynamicLibrary {
|
|
static_data: static_data::test::build(),
|
|
stat_calculator: BattleStatCalculator {},
|
|
}
|
|
}
|
|
}
|