Class ItemSlot

java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
com.badlogic.gdx.scenes.scene2d.ui.Stack
com.csse3200.game.components.inventory.ItemSlot
All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Cullable, com.badlogic.gdx.scenes.scene2d.utils.Layout

public class ItemSlot extends com.badlogic.gdx.scenes.scene2d.ui.Stack
A class used to combine all the data necessary to the individual inventory slots
  • Constructor Summary

    Constructors
    Constructor
    Description
    ItemSlot(boolean selected)
    Construct an itemSlot with a selected state
    ItemSlot(com.badlogic.gdx.graphics.Texture itemTexture, boolean selected)
    Construct an itemSlot with a texture and selected state
    ItemSlot(com.badlogic.gdx.graphics.Texture itemTexture, Integer count, boolean selected)
    Construct an itemSlot with a texture, count and selected state
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the item count
    com.badlogic.gdx.scenes.scene2d.ui.Stack
     
    com.badlogic.gdx.scenes.scene2d.ui.Image
    Get the item image
    com.badlogic.gdx.graphics.Texture
    Set the item texture
    void
    Set the item count
    void
    setDraggable(com.badlogic.gdx.scenes.scene2d.ui.Stack stack)
     
    void
    setItemImage(com.badlogic.gdx.scenes.scene2d.ui.Image image)
     
    void
    Make the slot selected
    void
    Make the slot unselected
     

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Stack

    add, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, invalidate, layout

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup

    childrenChanged, draw, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validate

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.Group

    act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, clear, clear, clearChildren, clearChildren, computeTransform, debugAll, drawChildren, drawDebug, drawDebugChildren, findActor, getChild, getChildren, getCullingArea, hasChildren, hit, isTransform, localToDescendantCoordinates, removeActor, removeActor, removeActorAt, resetTransform, resetTransform, setCullingArea, setDebug, setStage, setTransform, swapActor, swapActor

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor

    addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebugBounds, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ItemSlot

      public ItemSlot(com.badlogic.gdx.graphics.Texture itemTexture, Integer count, boolean selected)
      Construct an itemSlot with a texture, count and selected state
      Parameters:
      itemTexture - texture of item's image
      count - count of item
      selected - boolean state of whether item slot is selected
    • ItemSlot

      public ItemSlot(com.badlogic.gdx.graphics.Texture itemTexture, boolean selected)
      Construct an itemSlot with a texture and selected state
      Parameters:
      itemTexture - texture of item's image
      selected - boolean state of whether item slot is selected
    • ItemSlot

      public ItemSlot(boolean selected)
      Construct an itemSlot with a selected state
      Parameters:
      selected - boolean state of whether item slot is selected
  • Method Details

    • getCount

      public Integer getCount()
      Get the item count
      Returns:
      count integer of number of item
    • setCount

      public void setCount(Integer count)
      Set the item count
      Parameters:
      count - integer of number of item
    • getItemTexture

      public com.badlogic.gdx.graphics.Texture getItemTexture()
      Set the item texture
      Returns:
      itemTexture texture of item's image
    • toString

      public String toString()
      Overrides:
      toString in class com.badlogic.gdx.scenes.scene2d.Group
    • getItemImage

      public com.badlogic.gdx.scenes.scene2d.ui.Image getItemImage()
      Get the item image
      Returns:
      the item image
    • setItemImage

      public void setItemImage(com.badlogic.gdx.scenes.scene2d.ui.Image image)
    • getDraggable

      public com.badlogic.gdx.scenes.scene2d.ui.Stack getDraggable()
    • setDraggable

      public void setDraggable(com.badlogic.gdx.scenes.scene2d.ui.Stack stack)
    • setSelected

      public void setSelected()
      Make the slot selected
    • setUnselected

      public void setUnselected()
      Make the slot unselected