1use serde::{Deserialize, Serialize};
7use std::collections::HashMap;
8
9#[derive(Debug, Default, Serialize, Deserialize)]
11pub struct KnowledgeBase {
12 pub damage_types: Vec<DamageType>,
13 pub defense_layers: Vec<DefenseLayer>,
14 pub skill_tags: Vec<SkillTag>,
15 pub classes: Vec<ClassInfo>,
16 pub archetypes: Vec<BuildArchetype>,
17}
18
19#[derive(Debug, Clone, Serialize, Deserialize)]
20pub struct DamageType {
21 pub name: String,
22 pub description: String,
23 pub scaling_stats: Vec<String>,
24 pub conversion_sources: Vec<String>,
25}
26
27#[derive(Debug, Clone, Serialize, Deserialize)]
28pub struct DefenseLayer {
29 pub name: String,
30 pub description: String,
31 pub effective_against: Vec<String>,
32 pub sources: Vec<String>,
33}
34
35#[derive(Debug, Clone, Serialize, Deserialize)]
36pub struct SkillTag {
37 pub name: String,
38 pub description: String,
39 pub affected_by: Vec<String>,
40}
41
42#[derive(Debug, Clone, Serialize, Deserialize)]
43pub struct ClassInfo {
44 pub name: String,
45 pub base_stats: HashMap<String, i32>,
46 pub ascendancies: Vec<AscendancyInfo>,
47 pub typical_archetypes: Vec<String>,
48}
49
50#[derive(Debug, Clone, Serialize, Deserialize)]
51pub struct AscendancyInfo {
52 pub name: String,
53 pub description: String,
54 pub key_nodes: Vec<String>,
55}
56
57#[derive(Debug, Clone, Serialize, Deserialize)]
58pub struct BuildArchetype {
59 pub name: String,
60 pub description: String,
61 pub typical_skills: Vec<String>,
62 pub key_uniques: Vec<String>,
63 pub defense_priorities: Vec<String>,
64}
65
66impl KnowledgeBase {
67 pub fn load() -> Self {
69 Self::default()
71 }
72
73 pub fn get_summary(&self, topic: &str) -> Option<String> {
75 match topic.to_lowercase().as_str() {
77 "damage" => Some(self.summarize_damage_types()),
78 "defense" => Some(self.summarize_defenses()),
79 _ => None,
80 }
81 }
82
83 fn summarize_damage_types(&self) -> String {
84 "Damage types: Physical, Fire, Cold, Lightning, Chaos".to_owned()
86 }
87
88 fn summarize_defenses(&self) -> String {
89 "Defense layers: Life, ES, Armour, Evasion, Resistances, Block".to_owned()
91 }
92
93 pub fn get_build_context(&self, _prompt: &str) -> String {
95 String::new()
97 }
98}