Class StationSystem

java.lang.Object
com.badlogic.ashley.core.EntitySystem
com.badlogic.ashley.systems.IteratingSystem
com.devcharles.piazzapanic.componentsystems.StationSystem

public class StationSystem extends com.badlogic.ashley.systems.IteratingSystem
This system manages player-station interaction and station food processing.
  • Field Details

    • input

    • interactingStation

      boolean interactingStation
    • factory

      EntityFactory factory
    • readyTint

      private TintComponent readyTint
    • tickAccumulator

      private float tickAccumulator
  • Constructor Details

  • Method Details

    • update

      public void update(float deltaTime)
      Description copied from class: com.badlogic.ashley.core.EntitySystem
      The update method called every tick.
      Overrides:
      update in class com.badlogic.ashley.systems.IteratingSystem
      Parameters:
      deltaTime - The time passed since last frame in seconds.
    • processEntity

      protected void processEntity(com.badlogic.ashley.core.Entity entity, float deltaTime)
      Description copied from class: com.badlogic.ashley.systems.IteratingSystem
      This method is called on every entity on every update call of the EntitySystem. Override this to implement your system's specific processing.
      Specified by:
      processEntity in class com.badlogic.ashley.systems.IteratingSystem
      Parameters:
      entity - The current Entity being processed
      deltaTime - The delta time between the last and current frame
    • processStation

      private void processStation(ControllableComponent controllable, StationComponent station)
      Try and process the food from the player.
    • interactStation

      private void interactStation(StationComponent station)
      Perform special action (flipping patties, etc.)
      Parameters:
      station - the station the action is being performed on.
    • processServe

      private void processServe(com.badlogic.ashley.core.Entity cook)
      Try to combine the ingredients at the top of the player's inventory stack (max 3) into a ready meal.
      Parameters:
      cook - the cook whos inventory is being used for creating the food.
    • tryServe

      private FoodComponent.FoodType tryServe(ControllableComponent controllable, int count)
      Attempt to create a food.
      Parameters:
      count - number of ingredients to combine
    • processBin

      private void processBin(ControllableComponent controllable)
      Destroy the top food in the inventory of a cook.
    • stationPickup

      private void stationPickup(StationComponent station, ControllableComponent controllable)
      Pick up ready food from a station
    • stationTick

      private void stationTick(StationComponent station, float deltaTime)
      Cook the food in the station. This progresses the timer in the food being cooked in the station.
      Parameters:
      station -
      deltaTime -
    • addedToEngine

      public void addedToEngine(com.badlogic.ashley.core.Engine engine)
      Description copied from class: com.badlogic.ashley.core.EntitySystem
      Called when this EntitySystem is added to an Engine.
      Overrides:
      addedToEngine in class com.badlogic.ashley.systems.IteratingSystem
      Parameters:
      engine - The Engine this system was added to.