rpg_base/character_window/src/traits.rs
2025-03-05 09:45:39 +01:00

24 lines
635 B
Rust

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 {
fn refresh(&mut self, world: &mut World, hero: Entity) -> Result<()>;
fn disable(&mut self, _world: &mut World, _hero: Entity) -> Result<()> {
Ok(())
}
fn base(&self) -> &Arc<GuiSnippet>;
}