Class StationCollider

  • All Implemented Interfaces:
    Subject<Chef>

    public class StationCollider
    extends com.badlogic.gdx.scenes.scene2d.Actor
    implements Subject<Chef>
    This is a collider that checks to see if the chef has entered its bounds. If it has then it notifies all the linked stations which chef has overlapped.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<Observer<Chef>> observers  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void act​(float delta)  
      void clearAllObservers()  
      void deregister​(Observer<Chef> observer)
      Stop an observer from receiving future updates from this subject
      Chef getLastNotification()  
      void notifyObservers​(Chef chef)  
      void register​(Observer<Chef> observer)
      Add an observer which will be notified with every new T
      • Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor

        addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, draw, drawDebug, 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

      • observers

        protected final java.util.List<Observer<Chef>> observers
    • Constructor Detail

      • StationCollider

        public StationCollider​(ChefManager manager)
    • Method Detail

      • act

        public void act​(float delta)
        Overrides:
        act in class com.badlogic.gdx.scenes.scene2d.Actor
      • register

        public void register​(Observer<Chef> observer)
        Description copied from interface: Subject
        Add an observer which will be notified with every new T
        Specified by:
        register in interface Subject<Chef>
        Parameters:
        observer - the observer to register to this subject
      • deregister

        public void deregister​(Observer<Chef> observer)
        Description copied from interface: Subject
        Stop an observer from receiving future updates from this subject
        Specified by:
        deregister in interface Subject<Chef>
        Parameters:
        observer - the observer to deregister from this subject
      • notifyObservers

        public void notifyObservers​(Chef chef)
        Specified by:
        notifyObservers in interface Subject<Chef>
        Parameters:
        chef - The new T to send to every registered observer
      • getLastNotification

        public Chef getLastNotification()
        Specified by:
        getLastNotification in interface Subject<Chef>
        Returns:
        the most recent value that was sent to the observers.