Class Station

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSubject​(Subject<Chef> chefSubject)  
      void deregisterFromAllSubjects()  
      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)  
      void drawDebug​(com.badlogic.gdx.graphics.glutils.ShapeRenderer shapes)
      Draw the outline of the shape of the station as a rectangle and draw a blue line from the centre of this station (which is an Observer) to the centre of the stationCollider that it is linked to (the Subject that this is registered to).
      protected void drawFoodTexture​(com.badlogic.gdx.graphics.g2d.Batch batch, com.badlogic.gdx.graphics.Texture foodTexture)
      Take a food texture and render it on top of the station at a smaller size than the station.
      StationActionUI.ActionAlignment getActionAlignment()  
      java.util.List<StationAction.ActionType> getActionTypes()  
      int getId()  
      java.util.List<Subject<Chef>> getSubjects()  
      void removeSubject​(Subject<Chef> chefSubject)  
      void reset()
      Reset the station values to be the default.
      void setImageRotation​(float rotation)  
      void update​(Chef chef)
      Take the chef sent from the Subject and decide what interactions are possible.
      • 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

      • id

        protected final int id
      • stationImage

        protected final com.badlogic.gdx.graphics.g2d.TextureRegion stationImage
      • inUse

        protected boolean inUse
      • chefSubjects

        protected final java.util.List<Subject<Chef>> chefSubjects
      • nearbyChef

        protected Chef nearbyChef
    • Method Detail

      • reset

        public void reset()
        Reset the station values to be the default.
      • setImageRotation

        public void setImageRotation​(float rotation)
      • draw

        public void draw​(com.badlogic.gdx.graphics.g2d.Batch batch,
                         float parentAlpha)
        Overrides:
        draw in class com.badlogic.gdx.scenes.scene2d.Actor
      • drawFoodTexture

        protected void drawFoodTexture​(com.badlogic.gdx.graphics.g2d.Batch batch,
                                       com.badlogic.gdx.graphics.Texture foodTexture)
        Take a food texture and render it on top of the station at a smaller size than the station.
        Parameters:
        batch - the sprite batch to draw rectangles to the screen.
        foodTexture - the texture to be drawn onto the screen.
      • drawDebug

        public void drawDebug​(com.badlogic.gdx.graphics.glutils.ShapeRenderer shapes)
        Draw the outline of the shape of the station as a rectangle and draw a blue line from the centre of this station (which is an Observer) to the centre of the stationCollider that it is linked to (the Subject that this is registered to).
        Overrides:
        drawDebug in class com.badlogic.gdx.scenes.scene2d.Actor
        Parameters:
        shapes - The renderer to use to draw debugging information
      • update

        public void update​(Chef chef)
        Take the chef sent from the Subject and decide what interactions are possible.
        Specified by:
        update in interface Observer<Chef>
        Parameters:
        chef - The chef that the station should interact with which is given from the Subject to this Observer.
      • getActionTypes

        public java.util.List<StationAction.ActionType> getActionTypes()
        Returns:
        the list of possible actions that this station based on the current state
      • 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.
        Parameters:
        action - the action that needs to be done by this station if it can.
      • getId

        public int getId()