engine/rpg_components/src/items/map_item.rs

45 lines
794 B
Rust
Raw Normal View History

2024-08-23 11:22:09 +00:00
use std::sync::Arc;
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-23 15:17:53 +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,
_game_handle: &GameHandle,
_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()
}
}