Class RecipeStation

  • All Implemented Interfaces:
    Observer<Chef>

    public class RecipeStation
    extends Station
    The RecipeStation class is a station representing the place in the kitchen where you combine ingredients to create food. The food can then be served to the customer via the station.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doStationAction​(StationAction.ActionType action)
      Given an action, the station should attempt to do that action based on the chef that is nearby or what ingredient(s) are currently on the station.
      void draw​(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
      Displays ingredients that have been placed on the station
      java.util.List<StationAction.ActionType> getActionTypes()
      Obtains the actions that can be currently performed depending on the states of the station itself and the selected chef
      void reset()
      Reset the station values to be the default.
      void updateOrderActions()
      Updates the current available actions based on the new customer's order
      • Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor

        act, addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebugBounds, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, hit, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setStage, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, sizeChanged, stageToLocalCoordinates, toBack, toFront, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • bunCount

        protected int bunCount
      • pattyCount

        protected int pattyCount
      • lettuceCount

        protected int lettuceCount
      • tomatoCount

        protected int tomatoCount
    • Constructor Detail

      • RecipeStation

        public RecipeStation​(int id,
                             com.badlogic.gdx.graphics.g2d.TextureRegion textureRegion,
                             StationUIController stationUIController,
                             StationActionUI.ActionAlignment alignment,
                             FoodTextureManager textureManager,
                             CustomerManager customerManager)
        The constructor method for the class
        Parameters:
        id - The unique identifier of the station
        textureRegion - The rectangular area of the texture
        stationUIController - The controller from which we can get show and hide the action buttons belonging to the station
        alignment - Dictates where the action buttons are shown
        textureManager - The controller from which we can get information on what texture each ingredient should have
        customerManager - The controller from which we can get information on what food needs to be served
    • Method Detail

      • reset

        public void reset()
        Description copied from class: Station
        Reset the station values to be the default.
        Overrides:
        reset in class Station
      • getActionTypes

        public java.util.List<StationAction.ActionType> getActionTypes()
        Obtains the actions that can be currently performed depending on the states of the station itself and the selected chef
        Overrides:
        getActionTypes in class Station
        Returns:
        actionTypes - the list of actions the station can currently perform.
      • doStationAction

        public void doStationAction​(StationAction.ActionType action)
        Given an action, the station should attempt to do that action based on the chef that is nearby or what ingredient(s) are currently on the station.
        Overrides:
        doStationAction in class Station
        Parameters:
        action - the action that needs to be done by this station if it can.
      • draw

        public void draw​(com.badlogic.gdx.graphics.g2d.Batch batch,
                         float parentAlpha)
        Displays ingredients that have been placed on the station
        Overrides:
        draw in class Station
        Parameters:
        batch - Used to display a 2D texture
        parentAlpha - The parent alpha, to be multiplied with this actor's alpha, allowing the parent's alpha to affect all children.
      • updateOrderActions

        public void updateOrderActions()
        Updates the current available actions based on the new customer's order