Package com.csse3200.game.services
Class ConfigService
java.lang.Object
com.csse3200.game.services.ConfigService
Service for managing the config files and data loading of the game.
-
Constructor Summary
ConstructorsConstructorDescriptionOn registration, the config service will use the FileLoader to load all config files. -
Method Summary
Modifier and TypeMethodDescriptionGets a particular achievement config.Gets all achievement configs.Gets all the achievement configs.String[]
Gets all the achievement keys.getDefenderConfig
(String key) Gets a particular defender config.Gets all the defender configs.Gets all the defender configs.String[]
Gets all the defender keys.getEnemyConfig
(String key) Gets a particular enemy config.Gets all the enemy configs.Gets all the enemy configs.String[]
Gets all the enemy keys.getGeneratorConfig
(String key) Gets a particular generator config.Gets all the generator configs.Gets all the generator configs.String[]
Gets all the generator keys.getItemConfig
(String key) Gets a particular item config.Gets all the item configs.Gets all the item configs.String[]
Gets all the item keys.getLevelConfig
(String key) Gets a particular level config.Gets all the level configs.Gets all the level configs.String[]
Gets all the level keys.loadAchievementConfigs
(String filename) Loads achievement configs from a file.net.dermetfan.utils.Pair
<Map<String, BaseDefenderConfig>, Map<String, BaseGeneratorConfig>> loadDefenceConfigs
(String filename) Loads defence configs from a file.loadEnemyConfigs
(String filename) Loads enemy configs from a file.loadItemConfigs
(String filename) Loads item configs from a file.loadLevelConfigs
(String filename) Loads level configs from a file.
-
Constructor Details
-
ConfigService
public ConfigService()On registration, the config service will use the FileLoader to load all config files.
-
-
Method Details
-
loadItemConfigs
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>, loadDefenceConfigsMap<String, BaseGeneratorConfig>> (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
Loads enemy configs from a file.- Parameters:
filename
- the filename to load from- Returns:
- the enemy configs
-
loadAchievementConfigs
Loads achievement configs from a file.- Parameters:
filename
- the filename to load from- Returns:
- the achievement configs
-
loadLevelConfigs
Loads level configs from a file.- Parameters:
filename
- the filename to load from- Returns:
- the level configs
-
getGeneratorConfig
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
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
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
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
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
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
Gets all the enemy configs.- Returns:
- All the enemy configs.
-
getItemConfigs
Gets all the item configs.- Returns:
- All the item configs.
-
getAchievementConfigs
Gets all achievement configs.- Returns:
- map of achievement key to config
-
getLevelConfigs
Gets all the level configs.- Returns:
- All the level configs.
-
getDefenderConfigs
Gets all the defender configs.- Returns:
- All the defender configs.
-
getGeneratorConfigs
Gets all the generator configs.- Returns:
- All the generator configs.
-
getLevelKeys
Gets all the level keys.- Returns:
- All the level keys.
-
getItemKeys
Gets all the item keys.- Returns:
- All the item keys.
-
getAchievementKeys
Gets all the achievement keys.- Returns:
- All the achievement keys.
-
getDefenderKeys
Gets all the defender keys.- Returns:
- All the defender keys.
-
getEnemyKeys
Gets all the enemy keys.- Returns:
- All the enemy keys.
-
getGeneratorKeys
Gets all the generator keys.- Returns:
- All the generator keys.
-
getGeneratorConfigValues
Gets all the generator configs.- Returns:
- All the generator configs.
-
getDefenderConfigValues
Gets all the defender configs.- Returns:
- All the defender configs.
-
getEnemyConfigValues
Gets all the enemy configs.- Returns:
- All the enemy configs.
-
getItemConfigValues
Gets all the item configs.- Returns:
- All the item configs.
-
getLevelConfigValues
Gets all the level configs.- Returns:
- All the level configs.
-
getAchievementConfigValues
Gets all the achievement configs.- Returns:
- All the achievement configs.
-