Package org.vyang.parkourwarrior
Class MapManager
java.lang.Object
org.vyang.parkourwarrior.MapManager
Properties data handler for Parkour Warrior.
This class manages the game's persistent data by reading and writing to a properties file. It stores map configurations, record times, and other game settings that persist between sessions.
- Since:
- 1.1
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMapManager(ParkourMain parkourMain) Constructs a newMapManagerwith a reference to the main game panel. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMap()Adds a new map to the game.voidCreates a new properties file with default map entries.voidLoads map and game data from the properties file.voidRemoves the current map from the game.voidSaves the current map and game data to the properties file.voidShows the map manager dialogue.
-
Field Details
-
gameMaps
The array of game maps loaded from the properties file.- Since:
- 1.5
-
-
Constructor Details
-
MapManager
Constructs a newMapManagerwith a reference to the main game panel.- Parameters:
parkourMain- the main game panel instance- Since:
- 1.1
-
-
Method Details
-
loadMapProperties
public void loadMapProperties()Loads map and game data from the properties file.Reads each numbered property entry and parses it into map number, path, type, default status, finish status, record times, and end positions, populating the corresponding lists in
ParkourMain.- Since:
- 1.1
-
saveMapProperties
public void saveMapProperties()Saves the current map and game data to the properties file.Writes all map entries from
ParkourMainlists back to the properties file, preserving the current game state.- Since:
- 1.1
-
createPropertiesFile
public void createPropertiesFile()Creates a new properties file with default map entries.This method is called when no existing properties file is found. It writes default map configurations and then reloads the properties.
- Since:
- 1.1
-
addMap
public void addMap()Adds a new map to the game.- Since:
- 1.2
-
removeMap
public void removeMap()Removes the current map from the game.- Since:
- 1.2
-
showMapManager
public void showMapManager()Shows the map manager dialogue.- Since:
- 1.5
-