Class LevelManager

java.lang.Object
rekit.persistence.level.LevelManager

public final class LevelManager extends Object
This class manages all Level depended stuff as defined in DataKey.
Author:
Dominik Fuchss
  • Field Details

    • GROUP_UNKNOWN

      public static final String 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 structure
      reloadUserData - 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 accessible
      UnexpectedTokenException - will thrown if syntax of Resources are wrong
    • getInfiniteLevel

      public static LevelDefinition getInfiniteLevel()
      Get the infinite level.
      Returns:
      the infinite level
    • getLOTDLevel

      public static LevelDefinition getLOTDLevel()
      Get the level-of-the-day level.
      Returns:
      the level-of-the-day level
    • getLevelById

      public static LevelDefinition getLevelById(String id)
      Load a level by id.
      Parameters:
      id - the level
      Returns:
      the level
    • getArcadeLevelGroups

      public static Map<String,List<String>> getArcadeLevelGroups()
      Get a map of arcade levels (grouped).
      Returns:
      a grouped (map) of arcade levels
    • addLevel

      public static String addLevel(LevelDefinition level, boolean reloadUserData)
      Add a level to the manager.
      Parameters:
      level - the level
      reloadUserData - indicates whether userdata file shall be reloaded for highscore etc.
      Returns:
      the id of the level
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable