# Inventory System ```mermaid classDiagram class PlayerInventoryComponent{ <> + OpenSingle(ItemPreview : ItemPreview) IventoryWindow } class InventoryComponent{ <> - InventoryName : Text - NumberOfSlots : int - inventoryType : inventoryType - Inventory : SlotStructure[] - MaxWeight : int - currentWeight : int - monyTranslator : I_MoneyTranslator - window : InventoryWindow + GetInventoryWindo(OppositeComponent : InventoryComponent) InventoryWindow + AddToInventory() + CheckBalance(value: int) : bool + AddMoney(Value : int) + RemoveMoney(Value : int) + RemoveFromInventory(Value : Int, Item : ItemStructure) : bool - PrepareInventory() - CreateStack() int - IsInInventory() bool - AddToStack() int - HasPartialStack() int } class InventoryWindow{ <> - Iventory : I_InventoryComponent + InventoryWindow(Iventory : I_InventoryComponent) - RenewInventorySlots() } class Stackslider{ <> - Iventory_Remove : I_InventoryComponent - Iventory_Add : I_InventoryComponent + InventoryWindow(Iventory_remove : I_InventoryComponent, Iventory_Add : I_InventoryComponent) - CheckBuyerValue() : int - setMaxAmount() - setMinAmount() - buy() } class InventorySlot{ <> - itemStructure : ItemStructure + InventorySlot(item : ItemStructure) + RightClick : EventDispatcher + LeftClick : EventDispatcher } class I_InventoryComponent{ <> + AddToInventory() + GetInventory(filters: Filterstructure) : SlotStructure[] + CheckBalance(value: int) : bool + AddMoney(Value : int) + RemoveMoney(Value : int) + RemoveFromInventory(Value : Int, Item : ItemStructure) : bool } class inventoryType{ <> Chest Dealer } class SlotStructure{ <> Quantety : int ItemStrcut : ItemStructure } class ItemStructure{ <> Name : Text IsStackable : Bool Description : Text IsConsumable : Text MaxStackSize : Int Durability : Float BuyValue : Int SellValue : Int Weight : Int Thumbnail : Texture_2D Item_Type : ItemType rarety : Rarety DealerInterest : DealerInterests } class Filterstruct{ <> Consuming_Item : bool Ingridient : bool Letters_Books : bool Necromant_Stuff : bool Wapon : bool Armor : bool Other : bool } class ItemType{ <> Consuming_Item Ingridient Letters_Books Necromant_Stuff Wapon Armor Other } class Rarety{ <> Common Uncommon Rare Mythic } class DealerInterests{ <> wholeDealer smith alchemist marketeer fence nekromant bankier } PlayerInventoryComponent --> InventoryComponent InventoryComponent --> inventoryType InventoryComponent --> SlotStructure InventoryComponent --> InventoryWindow InventoryComponent --> Stackslider InventoryWindow --> InventorySlot InventorySlot --> ItemStructure InventoryWindow --> Filterstruct Stackslider --> I_InventoryComponent InventoryWindow --> I_InventoryComponent InventoryComponent --> I_InventoryComponent SlotStructure --> ItemStructure ItemStructure --> ItemType ItemStructure --> Rarety ItemStructure --> DealerInterests ```