Class EntityManager

java.lang.Object
com.mygdx.game.Managers.EntityManager

public final class EntityManager
extends java.lang.Object
Responsible for Managing the entity and component events. Entity's can be accessed by a String name
  • Constructor Summary

    Constructors
    Constructor Description
    EntityManager()  
  • Method Summary

    Modifier and Type Method Description
    static void addComponent​(Component c)
    Dont call manually
    static void addEntity​(Entity e)
    Dont call manually
    static void changeName​(java.lang.String prev, java.lang.String new_)
    changes the entity's name
    static void cleanUp()
    Cleans up all entities and components.
    static float getDeltaTime()
    gets the time between the last from and the current
    static Entity getEntity​(java.lang.String name)
    gets the first entity found with the given name
    static int getFPS()  
    static void Initialize()
    Should only be called once although if it isn't called at all it will be called automatically
    static void raiseEvents​(ComponentEvent... comps)
    raises the appropriate events for each entity's component.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EntityManager

      public EntityManager()
  • Method Details

    • Initialize

      public static void Initialize()
      Should only be called once although if it isn't called at all it will be called automatically
    • addComponent

      public static void addComponent​(Component c)
      Dont call manually
      Parameters:
      c - the comp to add
    • addEntity

      public static void addEntity​(Entity e)
      Dont call manually
      Parameters:
      e - the entity to add
    • getEntity

      public static Entity getEntity​(java.lang.String name)
      gets the first entity found with the given name
      Parameters:
      name - name of the entity
      Returns:
      the found entity
    • changeName

      public static void changeName​(java.lang.String prev, java.lang.String new_)
      changes the entity's name
      Parameters:
      prev - old name
      new_ - new name
    • raiseEvents

      public static void raiseEvents​(ComponentEvent... comps)
      raises the appropriate events for each entity's component. then renders after all entities have being processed if render is requested
      Parameters:
      comps - calls the events left to right
    • cleanUp

      public static void cleanUp()
      Cleans up all entities and components. Disposes of the primary sprite batch
    • getDeltaTime

      public static float getDeltaTime()
      gets the time between the last from and the current
      Returns:
      1/FPS
    • getFPS

      public static int getFPS()