make inv item stuff serializable
This commit is contained in:
parent
9de04ad87b
commit
2d5f83fab6
@ -17,10 +17,10 @@ use crate::ship::drops::ItemDropType;
|
||||
pub struct ItemEntityId(pub u32);
|
||||
#[derive(Hash, PartialEq, Eq, Debug, Clone)]
|
||||
pub struct ItemId(u32);
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
|
||||
pub struct BankName(pub String);
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum ItemLocation {
|
||||
Inventory {
|
||||
character_id: CharacterEntityId,
|
||||
@ -167,7 +167,7 @@ pub struct NewItemEntity {
|
||||
pub item: ItemDetail,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ItemEntity {
|
||||
pub id: ItemEntityId,
|
||||
pub location: ItemLocation,
|
||||
@ -175,7 +175,7 @@ pub struct ItemEntity {
|
||||
}
|
||||
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub enum InventoryItemEntity {
|
||||
Individual(ItemEntity),
|
||||
Stacked(Vec<ItemEntity>),
|
||||
|
@ -3,8 +3,9 @@ mod floor;
|
||||
mod inventory;
|
||||
mod manager;
|
||||
pub mod use_tool;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct ClientItemId(pub u32);
|
||||
|
||||
// TODO: remove these and fix use statements in the rest of the codebase
|
||||
|
Loading…
x
Reference in New Issue
Block a user