Class WorldManager

java.lang.Object
fr.phylisiumstudio.logic.WorldManager

public class WorldManager extends Object
Manage the worlds and the threads associated with them
  • Constructor Details

    • WorldManager

      public WorldManager()
  • Method Details

    • registerWorld

      public void registerWorld(WorldPhysics world)
      Register a world with the physics engine
      Parameters:
      world - The world to register
    • unregisterWorld

      public void unregisterWorld(WorldPhysics world)
      Unregister a world from the physics engine
      Parameters:
      world - The world to unregister
    • startWorldPhysics

      public void startWorldPhysics(WorldPhysics worldPhysics)
      Start the physics for a world
      Parameters:
      worldPhysics - The world physics
    • getWorld

      public WorldPhysics getWorld(UUID worldId)
      Get the world physics associated with the world
      Parameters:
      worldId - The world id
      Returns:
      The world physics
    • isWorldRegistered

      public boolean isWorldRegistered(UUID worldId)
      Check if a world is registered
      Parameters:
      worldId - The world id
      Returns:
      True if the world is registered
    • shutdown

      public void shutdown()
      Shutdown the world manager
    • getPhysicsThreadManager

      public PhysicsThreadManager getPhysicsThreadManager()
    • getWorlds

      public ConcurrentMap<UUID,WorldPhysics> getWorlds()
      Get all the worlds being managed
      Returns:
      a copy of the worlds