Class PlateComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.items.ItemComponent
com.csse3200.game.components.items.PlateComponent
PlateComponent manages everything about plates
state of plate, item on plate, availability of plate, pickup status of plate
servable status of plate, stacked status of plate, stackPlateArray to store id of plates in a stacked plates
plate id (for single plates) and quantity of plates in a stack
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
2 possible states of plates -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.csse3200.game.components.items.ItemComponent
getItemId, getItemName, getItemType, getTexturePath, getWeight
Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
PlateComponent
public PlateComponent(int id) Constructor for the PlateComponent. Initialises the plate state and id of the plate.- Parameters:
id
- - the unique id for the plate component being created.
-
-
Method Details
-
create
public void create()Creating the component. Sets up event listeners for plate -
update
public void update()Update plate, nothing to see here. -
getPlateState
- Returns:
-
getPlateId
public int getPlateId()Returns the plate id.- Returns:
- - an integer representing the plate id.
-
isClean
public boolean isClean()Returns true if the plate is clean.- Returns:
- - true if the plate is clean, false otherwise.
-
washPlate
public void washPlate()Sets the plate state to CLEAN. -
usePlate
public void usePlate()Sets the plate state to DIRTY.
-