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-25 12:30:03 +00:00
|
|
|
use super::{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()
|
|
|
|
}
|
|
|
|
pub fn from_persistent<'a>(
|
|
|
|
mut _split: impl Iterator<Item = &'a str>,
|
|
|
|
_item_system: &ItemSystem,
|
|
|
|
) -> 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()
|
|
|
|
}
|
|
|
|
}
|