Package fr.olympus.prometheus.resources
Class PrometheusData
java.lang.Object
fr.olympus.prometheus.resources.PrometheusData
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 Summary
ConstructorsConstructorDescriptionConstructs a PrometheusData instance with an empty entities registry. -
Method Summary
Modifier and TypeMethodDescriptioncreateEntity(String registryId) Creates a new entity instance based on the provided registry identifier.voiddestroyEntity(IEntity iEntity) Destroys an entity by removing it from the list of loaded entities.getEvolutionCondition(String conditionId) Retrieves an evolution condition from the evolution registry by its unique identifier.Retrieves the list of currently loaded entities.getLoadedEntitiesInGroups(String... groupsId) Retrieves a list of currently loaded entities that belong to any of the specified groups.getLoadedEntitiesWithId(String registryId) Retrieves a list of currently loaded entities that have the specified registry identifier.getLoadedEntitiesWithIds(String... registryIds) Retrieves a list of currently loaded entities that have any of the specified registry identifiers.getLoadedEntityWithUUID(UUID uuid) Retrieves a currently loaded entity that has the specified unique identifier (UUID).isInGroups(String... groupsId) Checks which entities in the registry belong to any of the specified groups and returns their unique identifiers.voidRegisters a new entity in the entities registry.voidRegisters a new evolution in the evolution registry.
-
Constructor Details
-
PrometheusData
public PrometheusData()Constructs a PrometheusData instance with an empty entities registry.
-
-
Method Details
-
registerEntity
Registers a new entity in the entities registry.- Parameters:
entry- The EntityRegistryEntry containing the entity's unique identifier and supplier.
-
registerEvolution
Registers a new evolution in the evolution registry.- Parameters:
entry- The EvolutionRegistryEntry containing the evolution's unique identifier and supplier.
-
getEvolutionCondition
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
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
Destroys an entity by removing it from the list of loaded entities.- Parameters:
iEntity- The entity instance to destroy.
-
isInGroups
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
Retrieves the list of currently loaded entities.- Returns:
- A list of IEntity instances representing the currently loaded entities.
-
getLoadedEntitiesInGroups
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
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
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
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.
-