Class PrometheusData

java.lang.Object
fr.olympus.prometheus.resources.PrometheusData

public class PrometheusData extends Object
Class representing the main data structure for managing entities and evolutions in the Prometheus system. It contains registries for entities and evolutions, as well as a list of currently loaded entities.
  • Constructor Details

    • PrometheusData

      public PrometheusData()
      Constructs a PrometheusData instance with an empty entities registry.
  • Method Details

    • registerEntity

      public void registerEntity(EntityRegistryEntry entry)
      Registers a new entity in the entities registry.
      Parameters:
      entry - The EntityRegistryEntry containing the entity's unique identifier and supplier.
    • registerEvolution

      public void registerEvolution(EvolutionRegistryEntry entry)
      Registers a new evolution in the evolution registry.
      Parameters:
      entry - The EvolutionRegistryEntry containing the evolution's unique identifier and supplier.
    • getEvolutionCondition

      public EvolutionCondition getEvolutionCondition(String conditionId)
      Retrieves an evolution condition from the evolution registry by its unique identifier.
      Parameters:
      conditionId - The unique identifier of the evolution condition to retrieve.
      Returns:
      An instance of EvolutionCondition corresponding to the provided unique identifier.
    • createEntity

      public IEntity createEntity(String registryId)
      Creates a new entity instance based on the provided registry identifier.
      Parameters:
      registryId - The unique identifier of the entity in the registry to create.
      Returns:
      An instance of Entity corresponding to the provided registry identifier.
    • destroyEntity

      public void destroyEntity(IEntity iEntity)
      Destroys an entity by removing it from the list of loaded entities.
      Parameters:
      iEntity - The entity instance to destroy.
    • isInGroups

      public List<String> isInGroups(String... groupsId)
      Checks which entities in the registry belong to any of the specified groups and returns their unique identifiers.
      Parameters:
      groupsId - The unique identifiers of the groups to check against.
      Returns:
      A list of unique identifiers of entities that belong to any of the specified groups.
    • getLoadedEntities

      public List<IEntity> getLoadedEntities()
      Retrieves the list of currently loaded entities.
      Returns:
      A list of IEntity instances representing the currently loaded entities.
    • getLoadedEntitiesInGroups

      public List<IEntity> getLoadedEntitiesInGroups(String... groupsId)
      Retrieves a list of currently loaded entities that belong to any of the specified groups.
      Parameters:
      groupsId - The unique identifiers of the groups to check against.
      Returns:
      A list of IEntity instances representing the currently loaded entities that belong to any of the specified groups.
    • getLoadedEntitiesWithId

      public List<IEntity> getLoadedEntitiesWithId(String registryId)
      Retrieves a list of currently loaded entities that have the specified registry identifier.
      Parameters:
      registryId - The unique identifier of the registry to check against.
      Returns:
      A list of IEntity instances representing the currently loaded entities that have the specified registry identifier.
    • getLoadedEntitiesWithIds

      public List<IEntity> getLoadedEntitiesWithIds(String... registryIds)
      Retrieves a list of currently loaded entities that have any of the specified registry identifiers.
      Parameters:
      registryIds - The unique identifiers of the registries to check against.
      Returns:
      A list of IEntity instances representing the currently loaded entities that have any of the specified registry identifiers.
    • getLoadedEntityWithUUID

      public IEntity getLoadedEntityWithUUID(UUID uuid)
      Retrieves a currently loaded entity that has the specified unique identifier (UUID).
      Parameters:
      uuid - The unique identifier (UUID) of the entity to retrieve.
      Returns:
      An instance of IEntity representing the currently loaded entity with the specified UUID, or null if no such entity is found.