use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Default, Serialize, Deserialize)]
pub struct KnowledgeBase {
pub damage_types: Vec<DamageType>,
pub defense_layers: Vec<DefenseLayer>,
pub skill_tags: Vec<SkillTag>,
pub classes: Vec<ClassInfo>,
pub archetypes: Vec<BuildArchetype>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DamageType {
pub name: String,
pub description: String,
pub scaling_stats: Vec<String>,
pub conversion_sources: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DefenseLayer {
pub name: String,
pub description: String,
pub effective_against: Vec<String>,
pub sources: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SkillTag {
pub name: String,
pub description: String,
pub affected_by: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClassInfo {
pub name: String,
pub base_stats: HashMap<String, i32>,
pub ascendancies: Vec<AscendancyInfo>,
pub typical_archetypes: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AscendancyInfo {
pub name: String,
pub description: String,
pub key_nodes: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BuildArchetype {
pub name: String,
pub description: String,
pub typical_skills: Vec<String>,
pub key_uniques: Vec<String>,
pub defense_priorities: Vec<String>,
}
impl KnowledgeBase {
pub fn load() -> Self {
Self::default()
}
pub fn get_summary(&self, topic: &str) -> Option<String> {
match topic.to_lowercase().as_str() {
"damage" => Some(self.summarize_damage_types()),
"defense" => Some(self.summarize_defenses()),
_ => None,
}
}
fn summarize_damage_types(&self) -> String {
"Damage types: Physical, Fire, Cold, Lightning, Chaos".to_owned()
}
fn summarize_defenses(&self) -> String {
"Defense layers: Life, ES, Armour, Evasion, Resistances, Block".to_owned()
}
pub fn get_build_context(&self, _prompt: &str) -> String {
String::new()
}
}