Package com.csse3200.game.areas
Class MapHandler
java.lang.Object
com.csse3200.game.areas.MapHandler
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic 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).static int
Get the number of bosses defeatedstatic <T extends GameArea>
TGet current mapstatic GameArea
getMap
(MapHandler.MapType mapType) Get map by typestatic boolean
checks if the requested map is unlocked yetstatic void
Deletes references to all maps and resets to original state.static void
setUnlockedAir
(boolean unlock) sets the state of unlocked air mapstatic void
setUnlockedWater
(boolean unlock) sets the state of unlocked water mapstatic 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.static void
Unlock the next area.static void
Updates the count of bosses defeated
-
Method Details
-
switchMapTo
Switch to a NEW map Set saveState to true will remember the previous map state, which can be restored later.- Parameters:
mapType
- map typerenderer
- renderergame
- game- Returns:
-
createNewMap
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 torenderer
- renderergame
- game- Returns:
- the new map
-
unlockNextArea
public static void unlockNextArea()Unlock the next area. Water is unlocked first, then air. -
getUnlockStatus
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
Get current map- Returns:
- current map
-
getMap
Get map by type- Parameters:
mapType
- map type- Returns:
- map
-