Package com.deco2800.game.entities
Class EntityService
java.lang.Object
com.deco2800.game.entities.EntityService
Provides a global access point for entities to register themselves. This allows for iterating
 over entities to perform updates each loop. All game entities should be registered here.
 Avoid adding additional state here! Global access is often the easy but incorrect answer to
 sharing data.
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Dispose all entities.com.badlogic.gdx.utils.Array<Entity>static booleanstatic voidPause and resume the game.static booleanCheck if the game is currently paused.static voidPause the game.voidRegister a new entity with the entity service.voidstatic voidUnpause the game.voidunregister(Entity entity) Unregister an entity with the entity service.voidupdate()Update all registered entities. 
- 
Constructor Details
- 
EntityService
public EntityService() 
 - 
 - 
Method Details
- 
register
Register a new entity with the entity service. The entity will be created and start updating.- Parameters:
 entity- new entity.
 - 
getEntityList
 - 
unregister
Unregister an entity with the entity service. The entity will be removed and stop updating.- Parameters:
 entity- entity to be removed.
 - 
update
public void update()Update all registered entities. Should only be called from the main game loop. - 
pauseAndResume
public static void pauseAndResume()Pause and resume the game. Used for main pausing function. - 
pauseGame
public static void pauseGame()Pause the game. Used for when the player is interacting with the inventory or UI. - 
unpauseGame
public static void unpauseGame()Unpause the game. Called when the exit button is clicked. NOTE: this method is meant to fix a minor bug of UI interactions. - 
pauseCheck
public static boolean pauseCheck()Check if the game is currently paused.- Returns:
 - Boolean of the game pause status.
 
 - 
toggleTimeStop
public void toggleTimeStop() - 
isTimeStopped
public static boolean isTimeStopped() - 
dispose
public void dispose()Dispose all entities. 
 -