Package com.csse3200.game.services
Class ServiceLocator
java.lang.Object
com.csse3200.game.services.ServiceLocator
A simplified implementation of the Service Locator pattern:
https://martinfowler.com/articles/injection.html#UsingAServiceLocator
Allows global access to a few core game services. Warning: global access is a trap and should be used extremely sparingly. Read the wiki for details (https://github.com/UQcsse3200/game-engine/wiki/Service-Locator).
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
static EntityPlacementService
static EntityService
static GameArea
static GameStateObserver
static InputService
static PhysicsService
static RenderService
static ResourceService
static StructurePlacementService
static TerrainService
static GameTime
static void
static void
registerEntityService
(EntityService service) static void
registerGameArea
(GameArea area) static void
static void
registerInputService
(InputService source) static void
registerPhysicsService
(PhysicsService service) static void
registerRenderService
(RenderService service) static void
static void
static void
registerTerrainService
(TerrainService source) static void
registerTimeSource
(GameTime source)
-
Method Details
-
getGameArea
-
registerGameArea
-
getEntityService
-
getRenderService
-
getPhysicsService
-
getTimeSource
-
getInputService
-
getResourceService
-
getGameStateObserverService
-
getStructurePlacementService
-
getTerrainService
-
getEntityPlacementService
-
registerStructurePlacementService
-
registerEntityPlacementService
-
registerEntityService
-
registerRenderService
-
registerPhysicsService
-
registerTimeSource
-
registerInputService
-
registerResourceService
-
registerTerrainService
-
registerGameStateObserverService
-
clear
public static void clear()
-