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
Modifier and TypeFieldDescription(package private) EntityFactory
(package private) KeyboardInput
(package private) boolean
private TintComponent
private float
Fields inherited from class com.badlogic.ashley.core.EntitySystem
priority
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addedToEngine
(com.badlogic.ashley.core.Engine engine) Called when this EntitySystem is added to anEngine
.private void
interactStation
(StationComponent station) Perform special action (flipping patties, etc.)private void
processBin
(ControllableComponent controllable) Destroy the top food in the inventory of a cook.protected void
processEntity
(com.badlogic.ashley.core.Entity entity, float deltaTime) This method is called on every entity on every update call of the EntitySystem.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.private void
processStation
(ControllableComponent controllable, StationComponent station) Try and process the food from the player.private void
stationPickup
(StationComponent station, ControllableComponent controllable) Pick up ready food from a stationprivate void
stationTick
(StationComponent station, float deltaTime) Cook the food in the station.private FoodComponent.FoodType
tryServe
(ControllableComponent controllable, int count) Attempt to create a food.void
update
(float deltaTime) The update method called every tick.Methods inherited from class com.badlogic.ashley.systems.IteratingSystem
getEntities, getFamily, removedFromEngine
Methods 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.EntitySystem
The update method called every tick.- Overrides:
update
in 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.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 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.EntitySystem
Called when this EntitySystem is added to anEngine
.- Overrides:
addedToEngine
in classcom.badlogic.ashley.systems.IteratingSystem
- Parameters:
engine
- TheEngine
this system was added to.
-