public class InventoryList
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static float |
LIST_WIDTH
Stores the width of the list in pixels for the target (480x320) resolution.
|
Constructor and Description |
---|
InventoryList(ItemManager itemManager,
Inventory inventory,
com.badlogic.gdx.scenes.scene2d.utils.ClickListener buttonListener,
float height)
Accepts the itemManager from which to retrieve the items' sprites, the inventory from which to retrieve the player's items,
the ClickListener to which button clicks will be delegated, and the height of the list.
|
Modifier and Type | Method and Description |
---|---|
void |
addItem(java.lang.Class itemClass,
int quantity)
Adds the given amount of items to the inventory.
|
boolean |
contains(com.badlogic.gdx.scenes.scene2d.Actor actor) |
void |
generateList()
Populates the list with buttons corresponding to all the items in the player's inventory.
|
java.lang.Class |
getButtonClass(com.badlogic.gdx.scenes.scene2d.Actor actor) |
com.badlogic.gdx.scenes.scene2d.ui.Table |
getTable()
Returns the table containing all of the buttons in the inventory list.
|
void |
updateList()
Called when the contents of the inventory list must be updated.
|
public static final float LIST_WIDTH
public InventoryList(ItemManager itemManager, Inventory inventory, com.badlogic.gdx.scenes.scene2d.utils.ClickListener buttonListener, float height)
public void generateList()
public void updateList()
public void addItem(java.lang.Class itemClass, int quantity)
public java.lang.Class getButtonClass(com.badlogic.gdx.scenes.scene2d.Actor actor)
public boolean contains(com.badlogic.gdx.scenes.scene2d.Actor actor)
public com.badlogic.gdx.scenes.scene2d.ui.Table getTable()