Class ItemComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.items.ItemComponent
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getCount()
Gets the current number of existing items that are the same within the gameGets the description for the itemgetName()
Returns the name of this item.Returns the texture path of the current itemgetType()
Returns the type of this item.void
setCount
(int count) setCount to set item_count at a given valuevoid
Sets the name of this item.void
setTexture
(String texture) Sets the texture path of the current itemvoid
Sets the type of this item.Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
ItemComponent
public ItemComponent()
-
-
Method Details
-
getName
Returns the name of this item.- Returns:
- the item's name
-
setName
Sets the name of this item.- Parameters:
name
- the new name for the item
-
getType
Returns the type of this item.- Returns:
- the item's
ItemTypes
type
-
setType
Sets the type of this item.- Parameters:
type
- theItemTypes
to assign to this item
-
getCount
public int getCount()Gets the current number of existing items that are the same within the game- Returns:
- the count for the item
-
setCount
public void setCount(int count) setCount to set item_count at a given value- Parameters:
count
- sets the item count
-
setTexture
Sets the texture path of the current item- Parameters:
texture
- sets the texture path of the current item
-
getTexture
Returns the texture path of the current item -
getDescription
Gets the description for the item- Returns:
- A formatted description of the item with its; name, id, type, and current count.
-