Class IngredientStationHandlerComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.station.IngredientStationHandlerComponent

public class IngredientStationHandlerComponent extends Component
  • Field Details

    • type

      protected final String type
      String type - storing type of station StationInventoryComponent inventory component - instance of inventory for this station TBD acceptableItems - HashMap, HashSet etc. of mappings for acceptable items based on station
    • inventoryComponent

      protected InventoryComponent inventoryComponent
    • collectionComponent

      protected StationCollectionComponent collectionComponent
    • ingredient

      protected final String ingredient
  • Constructor Details

    • IngredientStationHandlerComponent

      public IngredientStationHandlerComponent(String type, String ingredient)
      General constructor
      Parameters:
      type - - storing type of station
  • 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.
      Overrides:
      create in class Component
    • getType

      public String getType()
      Gets the type of station
      Returns:
      station type
    • getIngredientName

      public String getIngredientName()
      Gets the ingredient stored at this station
      Returns:
      String of ingredient
    • 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 component
      inventoryDisplay - reference to individual inventory display
      type - 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 inventory