Class ConfigService

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

public class ConfigService extends Object
Service for managing the config files and data loading of the game.
  • Constructor Details

    • ConfigService

      public ConfigService()
      On registration, the config service will use the FileLoader to load all config files.
  • Method Details

    • loadItemConfigs

      public Map<String,BaseItemConfig> loadItemConfigs(String filename)
      Loads item configs from a file.
      Parameters:
      filename - the filename to load from
      Returns:
      the item configs
    • loadDefenceConfigs

      public net.dermetfan.utils.Pair<Map<String,BaseDefenderConfig>,Map<String,BaseGeneratorConfig>> loadDefenceConfigs(String filename)
      Loads defence configs from a file.
      Parameters:
      filename - the filename to load from
      Returns:
      a pair of the defenders and generators configs
    • loadEnemyConfigs

      public Map<String,BaseEnemyConfig> loadEnemyConfigs(String filename)
      Loads enemy configs from a file.
      Parameters:
      filename - the filename to load from
      Returns:
      the enemy configs
    • loadAchievementConfigs

      public Map<String,BaseAchievementConfig> loadAchievementConfigs(String filename)
      Loads achievement configs from a file.
      Parameters:
      filename - the filename to load from
      Returns:
      the achievement configs
    • loadLevelConfigs

      public Map<String,BaseLevelConfig> loadLevelConfigs(String filename)
      Loads level configs from a file.
      Parameters:
      filename - the filename to load from
      Returns:
      the level configs
    • getGeneratorConfig

      public BaseGeneratorConfig getGeneratorConfig(String key)
      Gets a particular generator config.
      Parameters:
      key - The identifier or name of the generator config to get.
      Returns:
      The generator config for the given key.
    • getDefenderConfig

      public BaseDefenderConfig getDefenderConfig(String key)
      Gets a particular defender config.
      Parameters:
      key - The identifier or name of the defender config to get.
      Returns:
      The defender config for the given key.
    • getEnemyConfig

      public BaseEnemyConfig getEnemyConfig(String key)
      Gets a particular enemy config.
      Parameters:
      key - The identifier or name of the enemy config to get.
      Returns:
      The enemy config for the given key.
    • getItemConfig

      public BaseItemConfig getItemConfig(String key)
      Gets a particular item config.
      Parameters:
      key - The identifier or name of the item config to get.
      Returns:
      The item config for the given key.
    • getLevelConfig

      public BaseLevelConfig getLevelConfig(String key)
      Gets a particular level config.
      Parameters:
      key - The identifier or name of the level config to get.
      Returns:
      The level config for the given key.
    • getAchievementConfig

      public BaseAchievementConfig getAchievementConfig(String key)
      Gets a particular achievement config.
      Parameters:
      key - The identifier or name of the achievement config to get.
      Returns:
      The achievement config for the given key.
    • getEnemyConfigs

      public Map<String,BaseEnemyConfig> getEnemyConfigs()
      Gets all the enemy configs.
      Returns:
      All the enemy configs.
    • getItemConfigs

      public Map<String,BaseItemConfig> getItemConfigs()
      Gets all the item configs.
      Returns:
      All the item configs.
    • getAchievementConfigs

      public Map<String,BaseAchievementConfig> getAchievementConfigs()
      Gets all achievement configs.
      Returns:
      map of achievement key to config
    • getLevelConfigs

      public Map<String,BaseLevelConfig> getLevelConfigs()
      Gets all the level configs.
      Returns:
      All the level configs.
    • getDefenderConfigs

      public Map<String,BaseDefenderConfig> getDefenderConfigs()
      Gets all the defender configs.
      Returns:
      All the defender configs.
    • getGeneratorConfigs

      public Map<String,BaseGeneratorConfig> getGeneratorConfigs()
      Gets all the generator configs.
      Returns:
      All the generator configs.
    • getLevelKeys

      public String[] getLevelKeys()
      Gets all the level keys.
      Returns:
      All the level keys.
    • getItemKeys

      public String[] getItemKeys()
      Gets all the item keys.
      Returns:
      All the item keys.
    • getAchievementKeys

      public String[] getAchievementKeys()
      Gets all the achievement keys.
      Returns:
      All the achievement keys.
    • getDefenderKeys

      public String[] getDefenderKeys()
      Gets all the defender keys.
      Returns:
      All the defender keys.
    • getEnemyKeys

      public String[] getEnemyKeys()
      Gets all the enemy keys.
      Returns:
      All the enemy keys.
    • getGeneratorKeys

      public String[] getGeneratorKeys()
      Gets all the generator keys.
      Returns:
      All the generator keys.
    • getGeneratorConfigValues

      public BaseGeneratorConfig[] getGeneratorConfigValues()
      Gets all the generator configs.
      Returns:
      All the generator configs.
    • getDefenderConfigValues

      public BaseDefenderConfig[] getDefenderConfigValues()
      Gets all the defender configs.
      Returns:
      All the defender configs.
    • getEnemyConfigValues

      public BaseEnemyConfig[] getEnemyConfigValues()
      Gets all the enemy configs.
      Returns:
      All the enemy configs.
    • getItemConfigValues

      public BaseItemConfig[] getItemConfigValues()
      Gets all the item configs.
      Returns:
      All the item configs.
    • getLevelConfigValues

      public BaseLevelConfig[] getLevelConfigValues()
      Gets all the level configs.
      Returns:
      All the level configs.
    • getAchievementConfigValues

      public BaseAchievementConfig[] getAchievementConfigValues()
      Gets all the achievement configs.
      Returns:
      All the achievement configs.