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 SummaryFieldsModifier and TypeFieldDescription(package private) EntityFactory(package private) KeyboardInput(package private) booleanprivate TintComponentprivate floatFields inherited from class com.badlogic.ashley.core.EntitySystempriority
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddedToEngine(com.badlogic.ashley.core.Engine engine) Called when this EntitySystem is added to anEngine.private voidinteractStation(StationComponent station) Perform special action (flipping patties, etc.)private voidprocessBin(ControllableComponent controllable) Destroy the top food in the inventory of a cook.protected voidprocessEntity(com.badlogic.ashley.core.Entity entity, float deltaTime) This method is called on every entity on every update call of the EntitySystem.private voidprocessServe(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.private voidprocessStation(ControllableComponent controllable, StationComponent station) Try and process the food from the player.private voidstationPickup(StationComponent station, ControllableComponent controllable) Pick up ready food from a stationprivate voidstationTick(StationComponent station, float deltaTime) Cook the food in the station.private FoodComponent.FoodTypetryServe(ControllableComponent controllable, int count) Attempt to create a food.voidupdate(float deltaTime) The update method called every tick.Methods inherited from class com.badlogic.ashley.systems.IteratingSystemgetEntities, getFamily, removedFromEngineMethods inherited from class com.badlogic.ashley.core.EntitySystemcheckProcessing, getEngine, setProcessing
- 
Field Details- 
inputKeyboardInput input
- 
interactingStationboolean interactingStation
- 
factoryEntityFactory factory
- 
readyTint
- 
tickAccumulatorprivate float tickAccumulator
 
- 
- 
Constructor Details- 
StationSystem
 
- 
- 
Method Details- 
updatepublic void update(float deltaTime) Description copied from class:com.badlogic.ashley.core.EntitySystemThe update method called every tick.- Overrides:
- updatein class- com.badlogic.ashley.systems.IteratingSystem
- Parameters:
- deltaTime- The time passed since last frame in seconds.
 
- 
processEntityprotected void processEntity(com.badlogic.ashley.core.Entity entity, float deltaTime) Description copied from class:com.badlogic.ashley.systems.IteratingSystemThis method is called on every entity on every update call of the EntitySystem. Override this to implement your system's specific processing.- Specified by:
- processEntityin class- com.badlogic.ashley.systems.IteratingSystem
- Parameters:
- entity- The current Entity being processed
- deltaTime- The delta time between the last and current frame
 
- 
processStationTry and process the food from the player.
- 
interactStationPerform special action (flipping patties, etc.)- Parameters:
- station- the station the action is being performed on.
 
- 
processServeprivate 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.
 
- 
tryServeAttempt to create a food.- Parameters:
- count- number of ingredients to combine
 
- 
processBinDestroy the top food in the inventory of a cook.
- 
stationPickupPick up ready food from a station
- 
stationTickCook the food in the station. This progresses the timer in the food being cooked in the station.- Parameters:
- station-
- deltaTime-
 
- 
addedToEnginepublic void addedToEngine(com.badlogic.ashley.core.Engine engine) Description copied from class:com.badlogic.ashley.core.EntitySystemCalled when this EntitySystem is added to anEngine.- Overrides:
- addedToEnginein class- com.badlogic.ashley.systems.IteratingSystem
- Parameters:
- engine- The- Enginethis system was added to.
 
 
-