Interface EntityDefManager
-
public interface EntityDefManagerEntityDefManager manages entity definitions
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Entity>getEntities()List<AbstractEntityDef>getEntityDef()<T extends AbstractEntityDef>
TgetEntityDef(int index)This is the preferred method to get an entity definition by it's internal index.<T> List<T>getEntityDef(Class<T> clazz)Returns a list of entity defs implementing or deriving from clazz<T extends AbstractEntityDef>
TgetEntityDef(String entityName)Get an entity definition by it's name.<T extends AbstractEntityDef>
TgetEntityDef(UUID entityDefUuid)Get an entity definition by it's UUID.intgetEntityDefIndex(AbstractEntityDef entityDef)Returns the entity def index of a given instance of AbstractEntityDefintgetEntityDefIndex(UUID entityDefUuid)Returns the entity def index by uuidStringgetEntityDefName(AbstractEntityDef entityDef)Returns the name of an entity definition by a given instance of AbstractEntityDefStringgetEntityDefName(UUID entityDefUuid)Returns the name of an entity definition by UUIDbooleanhasDefinition()voidloadDefinition(String modName, InputStream in)voidloadDefinition(List<Entity> newEntityDef)static EntityDefManagerprovide()voidreset()intsize()
-
-
-
Method Detail
-
provide
static EntityDefManager provide()
-
reset
@RestrictedMethod void reset()
-
loadDefinition
@RestrictedMethod void loadDefinition(String modName, InputStream in)
-
loadDefinition
@RestrictedMethod void loadDefinition(List<Entity> newEntityDef)
-
getEntityDef
List<AbstractEntityDef> getEntityDef()
-
getEntityDef
<T extends AbstractEntityDef> T getEntityDef(int index)
This is the preferred method to get an entity definition by it's internal index. It offers the best performance. The index can be usually looked up from a live entity if it has already been added to entity manager (AbstractEntity#getEntityDef) or from #getEntityDefIndex. Example: final MeshBufferDef meshBufferDef = EntityDefManager.provide().getEntityDef(entity.getEntityDef());
-
getEntityDef
<T extends AbstractEntityDef> T getEntityDef(UUID entityDefUuid)
Get an entity definition by it's UUID. UUID is portable and can be persisted whereas index is only valid during a game session.
-
getEntityDef
<T extends AbstractEntityDef> T getEntityDef(String entityName)
Get an entity definition by it's name. Name is portable and can be easily read in your code but the lookup by name does not have the same performance as getting it by index.
-
getEntityDef
<T> List<T> getEntityDef(Class<T> clazz)
Returns a list of entity defs implementing or deriving from clazz
-
getEntityDefIndex
int getEntityDefIndex(UUID entityDefUuid)
Returns the entity def index by uuid
-
getEntityDefIndex
int getEntityDefIndex(AbstractEntityDef entityDef)
Returns the entity def index of a given instance of AbstractEntityDef
-
getEntityDefName
String getEntityDefName(UUID entityDefUuid)
Returns the name of an entity definition by UUID
-
getEntityDefName
String getEntityDefName(AbstractEntityDef entityDef)
Returns the name of an entity definition by a given instance of AbstractEntityDef
-
hasDefinition
boolean hasDefinition()
-
size
int size()
-
-