Player Inventory
Last updated
Last updated
public Dictionary<uint, PlayerInventorySlot> playerInventorySlots
: Represents the inventory slots available to the player.
public PlayerInventory(PlayerWorker playerWorker)
: Initializes a new instance of the PlayerInventory
class, assigning the PlayerWorker
and initializing the playerInventorySlots
dictionary.
public void UseItem(uint index)
: Handles the usage of an item from the inventory. It retrieves the item from playerInventorySlots
using the provided index and then applies the item's effect by invoking AddEffect
on the elementWorker.elementEffect
of the associated playerWorker
.