Interface EntityDefManager


  • public interface EntityDefManager
    EntityDefManager manages entity definitions
    • Method Detail

      • 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()