Package gaiasky.scene

Class Archetypes

java.lang.Object
gaiasky.scene.Archetypes

public class Archetypes extends Object
  • Field Details

    • archetypes

      protected Map<String,Archetype> archetypes
      Archetypes map, links old scene graph model objects to artemis archetypes.
  • Constructor Details

    • Archetypes

      public Archetypes()
      Creates a new arch-types container.
  • Method Details

    • initialize

      public void initialize(com.badlogic.ashley.core.Engine engine)
      Initializes the archetypes map with an entry for each model object.
    • contains

      public boolean contains(String key)
    • get

      public Archetype get(String key)
      Gets an archetype by name (key).
      Parameters:
      key - The name of the archetype.
      Returns:
      The archetype.
    • get

      public Archetype get(Class archetypeClass)
      Gets an archetype by class.
      Parameters:
      archetypeClass - The class of the archetype.
      Returns:
      The archetype.
    • findArchetype

      public Archetype findArchetype(com.badlogic.ashley.core.Entity entity)
      Finds a matching archetype given an entity.
      Parameters:
      entity - The entity.
      Returns:
      The matching archetype if it exists, or null if it does not.
    • initializeArchetypes

      public Map<String,Archetype> initializeArchetypes()