Package org.collebol.game.world
Class World
java.lang.Object
org.collebol.game.world.World
Abstract class representing a game world in the EJGEngine.
This class is responsible for managing chunks, world loading, and world generation.
Usage:
World myWorld = new MyWorld("worldName", MyChunk.class);
myWorld.setWorldLoader(new MyWorldLoader(myWorld));
myWorld.registerWorldGenerator(new MyWorldGenerator(myWorld));
- Since:
- 1.0-dev
- Author:
- ColleBol - contact@collebol.org
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a World instance with the specified name and chunk format.Constructs a World instance with the specified name, chunk format, and world folder. -
Method Summary
Modifier and TypeMethodDescriptionvoidgetChunk(int chunkX, int chunkY) Returns the loaded chunk at the given chunk coordinates, or null if it is not loaded.Class<?> getName()voidregisterWorldGenerator(WorldGenerator worldGenerator) voidvoidsetWorldFolder(File worldFolder) voidsetWorldLoader(WorldLoader worldLoader)
-
Constructor Details
-
World
Constructs a World instance with the specified name and chunk format.- Parameters:
name- the name of the worldchunkFormat- the class representing the chunk format
-
World
Constructs a World instance with the specified name, chunk format, and world folder.- Parameters:
name- the name of the worldchunkFormat- the class representing the chunk formatworldFolder- the folder where the world data is stored
-
-
Method Details
-
getName
-
getChunkFormat
-
addChunk
-
getChunks
-
getChunk
Returns the loaded chunk at the given chunk coordinates, or null if it is not loaded.- Parameters:
chunkX- the X coordinate of the chunkchunkY- the Y coordinate of the chunk- Returns:
- the loaded Chunk if present, otherwise null
-
setChunks
-
getWorldLoader
-
getWorldGenerator
-
setWorldLoader
-
registerWorldGenerator
-
getWorldFolder
-
setWorldFolder
-
getWorldFileManager
-