Class PlateStationHandlerComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.station.PlateStationHandlerComponent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InventoryComponentprotected final StringString type - storing type of station String ingredient - storing the item type dispensed by this station StationInventoryComponent inventory component - instance of inventory for this station -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Called on creation of the station to allow outside interaction within the station.getType()Gets the type of stationvoidhandleInteraction(InventoryComponent playerInventoryComponent, InventoryDisplay inventoryDisplay, String type) Handles any interaction with station, using current state of player and station inventory to determine intended interaction.voidstationGiveItem(InventoryComponent playerInventoryComponent, InventoryDisplay inventoryDisplay) Takes the item from the station, and returns the old itemMethods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Field Details
-
type
String type - storing type of station String ingredient - storing the item type dispensed by this station StationInventoryComponent inventory component - instance of inventory for this station- See Also:
-
inventoryComponent
-
-
Constructor Details
-
PlateStationHandlerComponent
public PlateStationHandlerComponent()General constructor
-
-
Method Details
-
create
public void create()Called on creation of the station to allow outside interaction within the station. Adds the listener for set current item and for remove current item. -
getType
Gets the type of station- Returns:
- - station type
-
handleInteraction
public void handleInteraction(InventoryComponent playerInventoryComponent, InventoryDisplay inventoryDisplay, String type) Handles any interaction with station, using current state of player and station inventory to determine intended interaction.- Parameters:
playerInventoryComponent- - reference to player inventory componentinventoryDisplay- - reference to individual inventory displaytype- - the type of interaction attempt
-
stationGiveItem
public void stationGiveItem(InventoryComponent playerInventoryComponent, InventoryDisplay inventoryDisplay) Takes the item from the station, and returns the old item- Parameters:
playerInventoryComponent- - reference to player inventoryinventoryDisplay- - reference to the inventory display for the station
-