45 lines
843 B
Rust
45 lines
843 B
Rust
use std::sync::Arc;
|
|
|
|
use anyhow::Result;
|
|
use engine::prelude::*;
|
|
|
|
use crate::components::inventory::Storable;
|
|
|
|
use super::{ItemSystem, Rarities, ToolTipBuilder};
|
|
|
|
#[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,
|
|
_tooltip_builder: &impl ToolTipBuilder,
|
|
_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()
|
|
}
|
|
}
|