Package ruscz.game.gameOfProd.Cells
Class ChestCell
- java.lang.Object
-
- ruscz.game.gameOfProd.Cells.Cell
-
- ruscz.game.gameOfProd.Cells.InteractionCell
-
- ruscz.game.gameOfProd.Cells.ChestCell
-
public class ChestCell extends InteractionCell
Special type of Interaction cell that holds an inventory
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.LinkedList<Item>chestInventoryprivate booleanisActiveprivate booleanshowItem-
Fields inherited from class ruscz.game.gameOfProd.Cells.InteractionCell
dialog, message, paint, scanner
-
-
Constructor Summary
Constructors Constructor Description ChestCell(int x, int y, java.lang.String inventory, Dialog dialog, Map map, WindowOfFreeMove window)ChestCell(int x, int y, java.lang.String inventory, Dialog dialog, Map map, WindowOfFreeMove window, boolean paint)
-
Method Summary
Modifier and Type Method Description private voidfillChest(java.lang.String inventory)Fills chest with item from filebooleangetPaint()booleangetShowItem()booleanisActive()voidpaint(java.awt.Graphics2D g)private voidputItemToInventory()Puts an item in Players inventoryvoidreadNextLine()Parses line of event text into set of commandsvoidsetActive(boolean active)voidstartEvent()Starts regular event or cut-scene-
Methods inherited from class ruscz.game.gameOfProd.Cells.InteractionCell
endEvent, equals, getDialog, getImageCell, getSoundManager, playCustscene, readDialogFile, useItem
-
-
-
-
Field Detail
-
chestInventory
private final java.util.LinkedList<Item> chestInventory
-
showItem
private boolean showItem
-
isActive
private boolean isActive
-
-
Constructor Detail
-
ChestCell
public ChestCell(int x, int y, java.lang.String inventory, Dialog dialog, Map map, WindowOfFreeMove window, boolean paint)
-
ChestCell
public ChestCell(int x, int y, java.lang.String inventory, Dialog dialog, Map map, WindowOfFreeMove window)
-
-
Method Detail
-
fillChest
private void fillChest(java.lang.String inventory)
Fills chest with item from file- Parameters:
inventory- name of inventory file
-
putItemToInventory
private void putItemToInventory()
Puts an item in Players inventory
-
startEvent
public void startEvent()
Description copied from class:InteractionCellStarts regular event or cut-scene- Overrides:
startEventin classInteractionCell
-
readNextLine
public void readNextLine()
Description copied from class:InteractionCellParses line of event text into set of commands- Overrides:
readNextLinein classInteractionCell
-
paint
public void paint(java.awt.Graphics2D g)
- Overrides:
paintin classInteractionCell
-
isActive
public boolean isActive()
-
setActive
public void setActive(boolean active)
-
getPaint
public boolean getPaint()
-
getShowItem
public boolean getShowItem()
-
-