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 CurrencyService
static EntityService
static GameEndService
static InputService
static MapService
static PhysicsService
static RenderService
static ResourceService
static GameTime
static WaveService
static void
registerCurrencyService
(CurrencyService service) static void
registerEntityService
(EntityService service) static void
registerGameEndService
(GameEndService source) static void
registerInputService
(InputService source) static void
registerMapService
(MapService source) static void
registerPhysicsService
(PhysicsService service) static void
registerRenderService
(RenderService service) static void
static void
registerTimeSource
(GameTime source) static void
registerWaveService
(WaveService source) static void
setTowerTypes
(Set<TowerType> selectedTowers)
-
Method Details
-
getCurrencyService
-
getEntityService
-
getRenderService
-
getPhysicsService
-
getTimeSource
-
getInputService
-
getResourceService
-
getGameEndService
-
getWaveService
-
getMapService
-
registerCurrencyService
-
registerEntityService
-
registerRenderService
-
registerPhysicsService
-
registerTimeSource
-
registerInputService
-
registerResourceService
-
registerGameEndService
-
registerWaveService
-
registerMapService
-
setTowerTypes
-
getTowerTypes
-
clear
public static void clear()
-