public class SlotsBlock
extends java.lang.Object
Constructor and Description |
---|
SlotsBlock(Slot[][] slotsTab)
Slots block constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes content from all slots
|
void |
draw(float x,
float y)
Draws all skill slots
|
java.util.List<Slot> |
getAllSlots() |
Slot |
getDragged()
Returns dragged slot
|
float |
getHeight()
Returns block height
|
Slot |
getMouseOver()
Returns slot on which mouse cursor is pointed
|
Slot |
getSlotOn(int slotRow,
int slotColumn) |
int[] |
getSlotPos(Slot slotToCheck)
Returns specified slot position in block
|
Slot[][] |
getSlots()
Return table with slots
|
float |
getWidth()
Returns block width
|
boolean |
insertContent(java.util.Collection<? extends SlotContent> contentCollection)
Insert whole content collection to block
|
boolean |
insertContent(SlotContent content)
Inserts content to first empty slot
|
boolean |
insertContentInto(SlotContent content,
int row,
int column)
Inserts content into specified slot
|
void |
moveContent(Slot slotA,
Slot slotB)
Moves content from slotA to slotB
|
boolean |
removeContent(SlotContent content)
Removes specified content from block
|
public SlotsBlock(Slot[][] slotsTab) throws org.newdawn.slick.SlickException, java.io.IOException
slotsTab
- Initialized multidimensional table with slotsorg.newdawn.slick.SlickException
java.io.IOException
public void draw(float x, float y)
x
- Position on x-axisy
- Position on y-axispublic void moveContent(Slot slotA, Slot slotB)
slotA
- Current skill slotslotB
- New slot for skillpublic boolean insertContent(SlotContent content)
content
- Some slot contentpublic boolean insertContent(java.util.Collection<? extends SlotContent> contentCollection)
contentCollection
- Collection with SlotContentpublic boolean insertContentInto(SlotContent content, int row, int column)
content
- Content to insertrow
- Row of desired slotcolumn
- Column of desired slotpublic boolean removeContent(SlotContent content)
content
- Slot contentpublic void clear()
public Slot getDragged()
public Slot getMouseOver()
public Slot[][] getSlots()
public java.util.List<Slot> getAllSlots()
public int[] getSlotPos(Slot slotToCheck)
slotToCheck
- Slot from this block to checkpublic Slot getSlotOn(int slotRow, int slotColumn)
public float getWidth()
public float getHeight()