Package rekit.persistence.level
Class LevelManager
java.lang.Object
rekit.persistence.level.LevelManager
This class manages all Level depended stuff as defined in
DataKey.- Author:
- Dominik Fuchss
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default group name of unknown arcade levels. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddArcadeLevel(InputStream levelStructure, boolean reloadUserData) Add a level by structure-file.static StringaddLevel(LevelDefinition level, boolean reloadUserData) Add a level to the manager.protected voidfinalize()Get a map of arcade levels (grouped).static LevelDefinitionGet the infinite level.static LevelDefinitiongetLevelById(String id) Load a level by id.static LevelDefinitionGet the level-of-the-day level.static voidinit()Load levels.
-
Field Details
-
GROUP_UNKNOWN
The default group name of unknown arcade levels.- See Also:
-
-
Method Details
-
init
public static void init()Load levels. -
addArcadeLevel
public static String addArcadeLevel(InputStream levelStructure, boolean reloadUserData) throws UnexpectedTokenException, IOException Add a level by structure-file.- Parameters:
levelStructure- the level structurereloadUserData- indicates whether userdata file shall be reloaded for highscore etc.- Returns:
- the id of the level or
nullif error occurred - Throws:
IOException- will thrown if Resources are not accessibleUnexpectedTokenException- will thrown if syntax of Resources are wrong
-
getInfiniteLevel
Get the infinite level.- Returns:
- the infinite level
-
getLOTDLevel
Get the level-of-the-day level.- Returns:
- the level-of-the-day level
-
getLevelById
Load a level by id.- Parameters:
id- the level- Returns:
- the level
-
getArcadeLevelGroups
Get a map of arcade levels (grouped).- Returns:
- a grouped (map) of arcade levels
-
addLevel
Add a level to the manager.- Parameters:
level- the levelreloadUserData- indicates whether userdata file shall be reloaded for highscore etc.- Returns:
- the id of the level
-
finalize
-