Class ItemObject
java.lang.Object
tech.underoaks.coldcase.state.tileContent.TileContent
tech.underoaks.coldcase.state.tileContent.ItemObject
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
GloveItem,TestItem,TestItem02
Generic
TileContent that is the Base of every Item that can be used in the Game.-
Field Summary
Fields inherited from class tech.underoaks.coldcase.state.tileContent.TileContent
tileContent, visibilityState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaction(InteractionChain chain, Interaction interaction) Performs the action associated with this TileContent when interacted with.com.badlogic.gdx.graphics.TextureGets the Texture that can be used to show the Item inside the InventoryvoidsetInventoryTexture(com.badlogic.gdx.graphics.Texture inventoryTexture) Sets the Texture that can be used to show the Item inside the Inventorybooleanupdate(InteractionChain chain, com.badlogic.gdx.math.Vector2 tilePosition, Interaction interaction, TileContent handler) Updates the state of this TileContent based on interactions.Methods inherited from class tech.underoaks.coldcase.state.tileContent.TileContent
clone, dispose, equals, getChildIndex, getNextContent, getTexture, getTileContentByIndex, getVisibilityState, handleAction, handleUpdate, isObjectPassable, isPlayerPassable, popContent, pushContent, render, setNextContent, setObjectPassable, setPlayerPassable, setTexture, setVisibilityState, topContent
-
Constructor Details
-
ItemObject
public ItemObject(com.badlogic.gdx.graphics.Texture texture) Default-Constructor- Parameters:
texture- TheTexturethat is representing the Item
-
-
Method Details
-
getInventoryTexture
public com.badlogic.gdx.graphics.Texture getInventoryTexture()Gets the Texture that can be used to show the Item inside the Inventory- Returns:
- The specified Texture
-
setInventoryTexture
public void setInventoryTexture(com.badlogic.gdx.graphics.Texture inventoryTexture) Sets the Texture that can be used to show the Item inside the Inventory- Parameters:
inventoryTexture- The specified Texture
-
action
public boolean action(InteractionChain chain, Interaction interaction) throws GameStateUpdateException Description copied from class:TileContentPerforms the action associated with this TileContent when interacted with.- Specified by:
actionin classTileContent- Parameters:
chain- InteractionChain managing the snapshot.interaction- The interaction to trigger.- Returns:
- True if the action has been taken care of; False otherwise
- Throws:
GameStateUpdateException- If a GameStateUpdate has failed
-
update
public boolean update(InteractionChain chain, com.badlogic.gdx.math.Vector2 tilePosition, Interaction interaction, TileContent handler) throws GameStateUpdateException Description copied from class:TileContentUpdates the state of this TileContent based on interactions.- Specified by:
updatein classTileContent- Parameters:
chain- InteractionChain managing the snapshot.tilePosition- The position of the currently selected tile.interaction- The interaction that is currently being handled.handler- The TileContent that has been handling the interaction so far.- Returns:
- True if an update has been performed; False otherwise
- Throws:
GameStateUpdateException- If a GameStateUpdate has failed
-