Class MapHandler

java.lang.Object
com.csse3200.game.areas.MapHandler

public class MapHandler extends Object
  • Method Details

    • switchMapTo

      public static GameArea switchMapTo(MapHandler.MapType mapType, Renderer renderer, GdxGame game)
      Switch to a NEW map Set saveState to true will remember the previous map state, which can be restored later.
      Parameters:
      mapType - map type
      renderer - renderer
      game - game
      Returns:
    • createNewMap

      public static GameArea createNewMap(MapHandler.MapType mapType, Renderer renderer, GdxGame game)
      Generates a new map - intended for use when a game is loaded, ie, so that the new map can be set without attempting to dispose of an old map (this should be handled by the screen). NOTE: Erases reference to old map without disposing of it.
      Parameters:
      mapType - - the type of map to initiaise to
      renderer - renderer
      game - game
      Returns:
      the new map
    • unlockNextArea

      public static void unlockNextArea()
      Unlock the next area. Water is unlocked first, then air.
    • getUnlockStatus

      public static boolean getUnlockStatus(MapHandler.MapType type)
      checks if the requested map is unlocked yet
      Returns:
      true iff the map is unlocked
    • getBossDefeatCount

      public static int getBossDefeatCount()
      Get the number of bosses defeated
      Returns:
      number of bosses defeated
    • updateBossDefeatCount

      public static void updateBossDefeatCount()
      Updates the count of bosses defeated
    • setUnlockedWater

      public static void setUnlockedWater(boolean unlock)
      sets the state of unlocked water map
      Parameters:
      unlock - the state of unlocked map
    • setUnlockedAir

      public static void setUnlockedAir(boolean unlock)
      sets the state of unlocked air map
      Parameters:
      unlock - the state of unlocked map
    • resetMapHandler

      public static void resetMapHandler()
      Deletes references to all maps and resets to original state.
    • getCurrentMap

      public static <T extends GameArea> T getCurrentMap()
      Get current map
      Returns:
      current map
    • getMap

      public static GameArea getMap(MapHandler.MapType mapType)
      Get map by type
      Parameters:
      mapType - map type
      Returns:
      map