Class PropertiesData
java.lang.Object
net.vincent.parkourwarrior.PropertiesData
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
-
Constructor Summary
ConstructorsConstructorDescriptionPropertiesData(ParkourMain parkourMain) Constructs a newPropertiesDatawith 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.
-
Constructor Details
-
PropertiesData
Constructs a newPropertiesDatawith a reference to the main game panel.- Parameters:
parkourMain- the main game panel instance- Since:
- 1.1
-
-
Method Details
-
loadProperties
public void loadProperties()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
-
saveProperties
public void saveProperties()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
-