use codegridfx::Module;
use num_traits::zero;
use rusterix::Map;
use theframework::prelude::*;
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct Item {
pub id: Uuid,
pub name: String,
pub map: Map,
#[serde(default)]
pub module: Module,
pub source: String,
#[serde(default)]
pub source_debug: String,
#[serde(default)]
pub data: String,
pub position: Vec3<f32>,
pub item_id: Uuid,
}
impl Default for Item {
fn default() -> Self {
Self::new()
}
}
impl Item {
pub fn new() -> Self {
Self {
id: Uuid::new_v4(),
name: "NewItem".to_string(),
module: Module::as_type(codegridfx::ModuleType::ItemTemplate),
map: Map::default(),
source: String::new(),
source_debug: String::new(),
data: String::new(),
position: zero(),
item_id: Uuid::new_v4(),
}
}
}