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 Summary
FieldsModifier and TypeFieldDescription(package private) EntityFactory(package private) KeyboardInput(package private) booleanprivate TintComponentprivate floatFields inherited from class com.badlogic.ashley.core.EntitySystem
priority -
Constructor Summary
Constructors -
Method Summary
Modifier 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.IteratingSystem
getEntities, getFamily, removedFromEngineMethods inherited from class com.badlogic.ashley.core.EntitySystem
checkProcessing, getEngine, setProcessing
-
Field Details
-
input
KeyboardInput input -
interactingStation
boolean interactingStation -
factory
EntityFactory factory -
readyTint
-
tickAccumulator
private float tickAccumulator
-
-
Constructor Details
-
StationSystem
-
-
Method Details
-
update
public void update(float deltaTime) Description copied from class:com.badlogic.ashley.core.EntitySystemThe update method called every tick.- Overrides:
updatein classcom.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.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 classcom.badlogic.ashley.systems.IteratingSystem- Parameters:
entity- The current Entity being processeddeltaTime- The delta time between the last and current frame
-
processStation
Try and process the food from the player. -
interactStation
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
Attempt to create a food.- Parameters:
count- number of ingredients to combine
-
processBin
Destroy the top food in the inventory of a cook. -
stationPickup
Pick up ready food from a station -
stationTick
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.EntitySystemCalled when this EntitySystem is added to anEngine.- Overrides:
addedToEnginein classcom.badlogic.ashley.systems.IteratingSystem- Parameters:
engine- TheEnginethis system was added to.
-