public class CraftingTable
extends java.lang.Object
Constructor and Description |
---|
CraftingTable(ItemManager itemManager,
Inventory inventory,
com.badlogic.gdx.scenes.scene2d.utils.ClickListener buttonListener)
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 the item inside a cell in the crafting table.
|
boolean |
containsItem(java.lang.Class itemClass)
Returns true if the given item is contained inside the crafting table.
|
void |
emptyTable(boolean transferToInventory)
Called when the user leaves the crafting menu.
|
void |
generateTable()
Called when the crafting table's widgets and its table must be created.
|
java.lang.Class |
getItemButtonClass(com.badlogic.gdx.scenes.scene2d.Actor actor)
Returns the class belonging to the given button.
|
com.badlogic.gdx.scenes.scene2d.ui.Table |
getTable()
Returns the table containing all the widgets in the crafting table.
|
boolean |
isCraftedItemButton(com.badlogic.gdx.scenes.scene2d.Actor actor)
Returns true if the given Actor is the craftedItemButton.
|
boolean |
isFull()
Returns true if the crafting table cannot take any more items.
|
boolean |
isItemButton(com.badlogic.gdx.scenes.scene2d.Actor actor)
Returns true if the given actor is an item button inside the crafting table.
|
void |
setCraftedItem(CraftingManager.Item craftedItem)
Sets the item displayed in craftedItem slot.
|
public CraftingTable(ItemManager itemManager, Inventory inventory, com.badlogic.gdx.scenes.scene2d.utils.ClickListener buttonListener)
public void generateTable()
public void addItem(java.lang.Class itemClass, int quantity)
public void setCraftedItem(CraftingManager.Item craftedItem)
public void emptyTable(boolean transferToInventory)
public com.badlogic.gdx.scenes.scene2d.ui.Table getTable()
public boolean isItemButton(com.badlogic.gdx.scenes.scene2d.Actor actor)
public java.lang.Class getItemButtonClass(com.badlogic.gdx.scenes.scene2d.Actor actor)
public boolean isCraftedItemButton(com.badlogic.gdx.scenes.scene2d.Actor actor)
public boolean containsItem(java.lang.Class itemClass)
public boolean isFull()