From f13db5cd9ff488b87cfbb036ab73fd07a9f207b5 Mon Sep 17 00:00:00 2001 From: YK Date: Sat, 13 Sep 2025 10:09:20 +0300 Subject: [PATCH] update entities defs --- src/entities/mock.rs | 17 +++++++++++++++-- src/entities/mod.rs | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/entities/mock.rs b/src/entities/mock.rs index 69005fa..05cf571 100644 --- a/src/entities/mock.rs +++ b/src/entities/mock.rs @@ -24,9 +24,9 @@ impl Dashboard { balance: Balance { platinum: 12, gold: 200, electrum: 1, silver: 101, copper: 129021021 }, spell_slots: SpellSlots(core::array::from_fn(|i| SpellSlotLevel { used: 1, total: 9 - i as u8 })), attunements: Attunements([const { None }; 3]), - hit_dice: HitDice { used: 1, total: 7 }, + hit_dice: HitDice { used: 1, kind: 20 }, death_save_throws: DeathSaveThrows { failed: 1, succeeded: 3 }, - prepared: PreparedSpells(vec![Spell { name: "Fire Bolt".to_owned() }]), + prepared: generate_prepared_spells_list(), inventory: generate_mock_inventory(), }, common: CommonData { @@ -36,6 +36,9 @@ impl Dashboard { quest_book: generate_mock_questbook(), notes: generate_mock_notebook(), people: generate_mock_contact_book(), + settings: Settings { + + } } } } @@ -161,3 +164,13 @@ fn generate_mock_contact_book () -> ContactBook { ContactBook(contacts) } + + +fn generate_prepared_spells_list () -> PreparedSpells { + use PreparedSpell::*; + let list = vec![ + + ]; + + PreparedSpells(list) +} diff --git a/src/entities/mod.rs b/src/entities/mod.rs index 117fc89..e36c9f0 100644 --- a/src/entities/mod.rs +++ b/src/entities/mod.rs @@ -48,6 +48,7 @@ pub struct Dashboard { pub quest_book: QuestBook, pub notes: NoteBook, pub people: ContactBook, + pub settings: Settings } #[derive(Clone, Debug, Store)] @@ -150,7 +151,14 @@ pub struct Attunements (pub [Option; 3]); #[derive(Clone, Debug, Store)] -pub struct PreparedSpells (pub Vec); +pub struct PreparedSpells (pub Vec); + + +#[derive(Clone, Debug, Store)] +pub enum PreparedSpell { + Vacant, + Occupied (Spell) +} // @TODO #[derive(Clone, Debug, Store)] @@ -161,7 +169,7 @@ pub struct Spell { #[derive(Clone, Debug, Store)] pub struct HitDice { pub used: u8, - pub total: u8, + pub kind: u8 } @@ -206,3 +214,8 @@ impl Name { !self.last.is_empty() } } + +#[derive(Clone, Debug, Store, Default)] +pub struct Settings { + +}