Class PlayerInventoryDisplay

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, Renderable, Comparable<Renderable>

public class PlayerInventoryDisplay extends InventoryDisplay
PlayerInventoryDisplay extends InventoryDisplay and adds features like hotbar and drag-and-drop functionality.
  • Constructor Details

    • PlayerInventoryDisplay

      public PlayerInventoryDisplay(Inventory inventory, int numCols, int hotBarCapacity, GdxGame game)
  • Method Details

    • updatePotions

      public void updatePotions(ItemUsageContext context)
      updates the potions effects if in or out of combat
    • toggleMsg

      public String toggleMsg()
      Specified by:
      toggleMsg in class InventoryDisplay
    • useItem

      protected void useItem(AbstractItem item, int index)
      Specified by:
      useItem in class InventoryDisplay
    • enterSlot

      protected void enterSlot(AbstractItem item)
      Specified by:
      enterSlot in class InventoryDisplay
    • exitSlot

      protected void exitSlot(AbstractItem item)
      Specified by:
      exitSlot in class InventoryDisplay
    • regenerateDisplay

      public void regenerateDisplay()
      Description copied from class: InventoryDisplay
      Regenerates the entire inventory and hotBar display (recreates every image) This should only be used if the inventory has been changed (ie after sorting or loading). Otherwise, use updateDisplay.
      Overrides:
      regenerateDisplay in class InventoryDisplay
    • clearInventory

      public void clearInventory()
      Clears the inventory of the player (used to empty inventory when loss condition satisfied in combat)