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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addComponent(Component c)
Don't call manuallystatic void
addEntity(Entity e)
Don't call manuallystatic void
changeName(java.lang.String prev, java.lang.String new_)
changes the entity's namestatic void
cleanUp()
Cleans up all entities and components.static float
getDeltaTime()
gets the time between the last from and the currentstatic void
Initialize()
Should only be called once although if it isn't called at all it will be called automaticallystatic void
raiseEvents(ComponentEvent... comps)
raises the appropriate events for each entity's component.
-
-
-
Method Detail
-
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)
Don't call manually- Parameters:
c
- the comp to add
-
addEntity
public static void addEntity(Entity e)
Don't call manually- Parameters:
e
- the entity to add
-
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
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
-
-