update entities defs

This commit is contained in:
YK 2025-09-13 10:09:20 +03:00
parent 37f2232af1
commit f13db5cd9f
2 changed files with 30 additions and 4 deletions

View File

@ -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)
}

View File

@ -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<String>; 3]);
#[derive(Clone, Debug, Store)]
pub struct PreparedSpells (pub Vec<Spell>);
pub struct PreparedSpells (pub Vec<PreparedSpell>);
#[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 {
}