Package org.collebol.game.world
Class WorldFileManager
java.lang.Object
org.collebol.game.world.WorldFileManager
The WorldFileManager class is responsible for saving and loading
Chunk in the game World.
It provides methods to serialize ad deserialize chunk data to and from binary files.
Usage:
WorldFileManager fileManager = new WorldFileManager(world);
fileManager.saveChunk(chunk); //save a chunk to binary file in worldfolder
Chunk loadedChunk = fileManager.loadChunk(chunkX, chunkY); //get chunk from binary file in worldfolder
- Since:
- 1.0-dev
- Author:
- ColleBol - contact@collebol.org
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
WorldFileManager
-
-
Method Details
-
saveChunk
Saves the specified chunk to a binary file.- Parameters:
chunk- the chunk to be saved.
-
loadChunk
Loads a chunk from binary file.- Parameters:
chunkX- the x-coordinate of the chunk.chunkY- the y-coordinate of the chunk.- Returns:
- the loaded chunk, or null if the file does not exist.
-