Class World

java.lang.Object
org.collebol.game.world.World

public abstract class World extends Object
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 Details

    • World

      public World(String name, Class<? extends Chunk> chunkFormat)
      Constructs a World instance with the specified name and chunk format.
      Parameters:
      name - the name of the world
      chunkFormat - the class representing the chunk format
    • World

      public World(String name, Class<? extends Chunk> chunkFormat, File worldFolder)
      Constructs a World instance with the specified name, chunk format, and world folder.
      Parameters:
      name - the name of the world
      chunkFormat - the class representing the chunk format
      worldFolder - the folder where the world data is stored
  • Method Details

    • getName

      public String getName()
    • getChunkFormat

      public Class<?> getChunkFormat()
    • addChunk

      public void addChunk(Chunk chunk)
    • getChunks

      public List<Chunk> getChunks()
    • setChunks

      public void setChunks(List<Chunk> chunks)
    • getWorldLoader

      public WorldLoader getWorldLoader()
    • getWorldGenerator

      public WorldGenerator getWorldGenerator()
    • setWorldLoader

      public void setWorldLoader(WorldLoader worldLoader)
    • registerWorldGenerator

      public void registerWorldGenerator(WorldGenerator worldGenerator)
    • getWorldFolder

      public File getWorldFolder()
    • setWorldFolder

      public void setWorldFolder(File worldFolder)
    • getWorldFileManager

      public WorldFileManager getWorldFileManager()