engine/rpg_components/src/items/map_item.rs
2024-08-27 14:06:06 +02:00

45 lines
857 B
Rust

use std::sync::Arc;
use anyhow::Result;
use engine::prelude::*;
use crate::components::inventory::Storable;
use super::{ability_book::Ability, ItemSystem, Rarities};
#[derive(Clone)]
pub struct MapItem {
rarity: Rarities,
icon: Arc<Image>,
}
impl MapItem {
pub fn into_persistent(&self) -> String {
String::new()
}
pub fn from_persistent<'a, A: Ability>(
mut _split: impl Iterator<Item = &'a str>,
_item_system: &ItemSystem<A>,
) -> Result<Self> {
todo!()
}
pub fn create_tooltip(
&self,
_gui_handler: &Arc<GuiHandler>,
_position: (i32, i32),
) -> Result<Arc<GuiBuilder>> {
todo!()
}
}
impl Storable for MapItem {
fn rarity(&self) -> Rarities {
self.rarity
}
fn icon(&self) -> Arc<Image> {
self.icon.clone()
}
}