rpg_base/character_window/src/traits.rs

25 lines
635 B
Rust
Raw Normal View History

2025-02-28 07:43:35 +00:00
use crate::*;
use std::sync::Arc;
use crate::content::ContentWrapper;
#[allow(unused)]
pub trait PageContentWrapper: Send + Sync {
fn content(&self) -> &dyn ContentWrapper;
fn content_mut(&mut self) -> &mut dyn ContentWrapper;
fn tooltip(&self) -> &Arc<GuiSnippet>;
fn right_side(&self) -> &dyn RightSide;
fn right_side_mut(&mut self) -> &mut dyn RightSide;
}
pub trait RightSide: Send + Sync {
2025-03-05 08:45:39 +00:00
fn refresh(&mut self, world: &mut World, hero: Entity) -> Result<()>;
2025-02-28 07:43:35 +00:00
2025-03-05 08:45:39 +00:00
fn disable(&mut self, _world: &mut World, _hero: Entity) -> Result<()> {
2025-02-28 07:43:35 +00:00
Ok(())
}
fn base(&self) -> &Arc<GuiSnippet>;
}