Package com.mygdx.game.Managers
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 voidaddComponent(Component c)Dont call manuallystatic voidaddEntity(Entity e)Dont call manuallystatic voidchangeName(java.lang.String prev, java.lang.String new_)changes the entity's namestatic voidcleanUp()Cleans up all entities and components.static floatgetDeltaTime()gets the time between the last from and the currentstatic EntitygetEntity(java.lang.String name)gets the first entity found with the given namestatic intgetFPS()static voidInitialize()Should only be called once although if it isn't called at all it will be called automaticallystatic voidraiseEvents(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
Dont call manually- Parameters:
c- the comp to add
-
addEntity
Dont call manually- Parameters:
e- the entity to add
-
getEntity
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 namenew_- new name
-
raiseEvents
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()
-