refactor InventoryItem #77

Closed
opened 2021-11-12 15:40:14 -05:00 by jake · 0 comments
Owner
pub struct IndividualInventoryItem {
    pub entity_id: ItemEntityId,
    pub item_id: ClientItemId,
    pub item: ItemDetail,
}

pub struct StackedInventoryItem {
    pub entity_ids: Vec<ItemEntityId>,
    pub item_id: ClientItemId,
    pub tool: Tool,
}

pub enum InventoryItem {
    Individual(IndividualInventoryItem),
    Stacked(StackedInventoryItem),
}

to

pub struct IndividualInventoryItem {
    pub entity_id: ItemEntityId,
    pub item: ItemDetail,
}

pub struct StackedInventoryItem {
    pub entity_ids: Vec<ItemEntityId>,
    pub tool: Tool,
}

pub enum InventoryItemDetail {
    Individual(IndividualInventoryItem),
    Stacked(StackedInventoryItem),
}

pub struct InventoryItem {
    pub item_id: ClientItemId,
    pub detail: InventoryItemDetail,
}

``` pub struct IndividualInventoryItem { pub entity_id: ItemEntityId, pub item_id: ClientItemId, pub item: ItemDetail, } pub struct StackedInventoryItem { pub entity_ids: Vec<ItemEntityId>, pub item_id: ClientItemId, pub tool: Tool, } pub enum InventoryItem { Individual(IndividualInventoryItem), Stacked(StackedInventoryItem), } ``` to ``` pub struct IndividualInventoryItem { pub entity_id: ItemEntityId, pub item: ItemDetail, } pub struct StackedInventoryItem { pub entity_ids: Vec<ItemEntityId>, pub tool: Tool, } pub enum InventoryItemDetail { Individual(IndividualInventoryItem), Stacked(StackedInventoryItem), } pub struct InventoryItem { pub item_id: ClientItemId, pub detail: InventoryItemDetail, } ```
jake added the
nice to have
item refactor
labels 2021-12-30 16:37:53 -05:00
jake closed this issue 2022-10-25 01:35:36 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jake/elseware#77
No description provided.