engine/rpg_components/src/items/map_item.rs

46 lines
857 B
Rust
Raw Normal View History

2024-08-23 11:22:09 +00:00
use std::sync::Arc;
2024-08-24 07:01:49 +00:00
use anyhow::Result;
2024-08-23 15:17:53 +00:00
use engine::prelude::*;
2024-08-23 17:09:23 +00:00
use crate::components::inventory::Storable;
2024-08-27 12:06:06 +00:00
use super::{ability_book::Ability, ItemSystem, Rarities};
2024-08-23 11:22:09 +00:00
#[derive(Clone)]
pub struct MapItem {
rarity: Rarities,
icon: Arc<Image>,
}
impl MapItem {
pub fn into_persistent(&self) -> String {
String::new()
}
2024-08-27 12:06:06 +00:00
pub fn from_persistent<'a, A: Ability>(
2024-08-23 11:22:09 +00:00
mut _split: impl Iterator<Item = &'a str>,
2024-08-27 12:06:06 +00:00
_item_system: &ItemSystem<A>,
2024-08-23 11:22:09 +00:00
) -> Result<Self> {
todo!()
}
pub fn create_tooltip(
&self,
2024-08-25 12:30:03 +00:00
_gui_handler: &Arc<GuiHandler>,
2024-08-23 11:22:09 +00:00
_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()
}
}