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 String
The default group name of unknown arcade levels. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
addArcadeLevel
(InputStream levelStructure, boolean reloadUserData) Add a level by structure-file.static String
addLevel
(LevelDefinition level, boolean reloadUserData) Add a level to the manager.protected void
finalize()
Get a map of arcade levels (grouped).static LevelDefinition
Get the infinite level.static LevelDefinition
getLevelById
(String id) Load a level by id.static LevelDefinition
Get the level-of-the-day level.static void
init()
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
null
if 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
-