Class ServiceLocator

java.lang.Object
com.csse3200.game.services.ServiceLocator

public class ServiceLocator extends Object
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 Details

    • getCurrencyService

      public static CurrencyService getCurrencyService()
    • getEntityService

      public static EntityService getEntityService()
    • getRenderService

      public static RenderService getRenderService()
    • getPhysicsService

      public static PhysicsService getPhysicsService()
    • getTimeSource

      public static GameTime getTimeSource()
    • getInputService

      public static InputService getInputService()
    • getResourceService

      public static ResourceService getResourceService()
    • getGameEndService

      public static GameEndService getGameEndService()
    • getWaveService

      public static WaveService getWaveService()
    • getMapService

      public static MapService getMapService()
    • registerCurrencyService

      public static void registerCurrencyService(CurrencyService service)
    • registerEntityService

      public static void registerEntityService(EntityService service)
    • registerRenderService

      public static void registerRenderService(RenderService service)
    • registerPhysicsService

      public static void registerPhysicsService(PhysicsService service)
    • registerTimeSource

      public static void registerTimeSource(GameTime source)
    • registerInputService

      public static void registerInputService(InputService source)
    • registerResourceService

      public static void registerResourceService(ResourceService source)
    • registerGameEndService

      public static void registerGameEndService(GameEndService source)
    • registerWaveService

      public static void registerWaveService(WaveService source)
    • registerMapService

      public static void registerMapService(MapService source)
    • setTowerTypes

      public static void setTowerTypes(Set<TowerType> selectedTowers)
    • getTowerTypes

      public static Set<TowerType> getTowerTypes()
    • clear

      public static void clear()