Package fr.olympus.prometheus.evolution
Interface EvolutionEntity
- All Superinterfaces:
IEntity
Interface for representing an entity that can evolve.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanEvolveTo(EvolutionCondition evolutionCondition) Checks if this entity can evolve to the given evolution condition.default booleanEvolves this entity to the given evolution condition ID if possible.default EvolutionConditiongetEvolutionCondition(String evolutionConditionID) Gets the evolution condition associated with the given evolution condition ID.Get the list of evolution conditions that can be applied to this entity.Get the list of evolution conditions that can be applied to this entity.default voidMerges the data of this entity with the given entity.Methods inherited from interface fr.olympus.prometheus.entity.IEntity
currentUUID, entityGroup, getName, getRegistryId, hasGroup, hasGroups, isAlive, kill, setAlive, setRegistryMeta
-
Method Details
-
getNextEvolutions
Get the list of evolution conditions that can be applied to this entity.- Returns:
- the list of evolution conditions that can be applied to this entity.
-
getPreviousEvolutions
Get the list of evolution conditions that can be applied to this entity.- Returns:
- the list of evolution conditions that can be applied to this entity.
-
canEvolveTo
Checks if this entity can evolve to the given evolution condition.- Parameters:
evolutionCondition- the evolution condition to check.- Returns:
- true if this entity can evolve to the given evolution condition, false otherwise.
-
getEvolutionCondition
Gets the evolution condition associated with the given evolution condition ID.- Parameters:
evolutionConditionID- the unique identifier of the evolution condition to retrieve.- Returns:
- the evolution condition associated with the given evolution condition ID, or null if no such evolution condition exists.
-
evolveTo
Evolves this entity to the given evolution condition ID if possible.- Parameters:
evolutionConditionID- the unique identifier of the evolution condition to evolve to.- Returns:
- true if this entity was successfully evolved to the given evolution condition ID, false otherwise.
-
mergeData
Merges the data of this entity with the given entity. This method is called when evolving to a new entity, and allows to transfer any relevant data from the old entity to the new one. Can be overridden by implementing classes to provide custom merging logic. By default, this method does nothing.- Parameters:
other- the entity to merge data with. This is the new entity that is being evolved to.
-