Class SimpleCondition

java.lang.Object
com.hypixel.hytale.server.npc.decisionmaker.core.conditions.base.Condition
com.hypixel.hytale.server.npc.decisionmaker.core.conditions.base.SimpleCondition
All Implemented Interfaces:
JsonAsset<String>, JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, Condition>>
Direct Known Subclasses:
HasTargetCondition, IsInStateCondition, LineOfSightCondition, SelfHasEffectCondition, TargetHasEffectCondition, TargetMovementStateCondition

public abstract class SimpleCondition extends Condition
Evaluates a simple boolean condition, returning one defined value for false and another for true.
Since:
2019/12/04
  • Field Details

  • Method Details

    • calculateUtility

      public double calculateUtility(int selfIndex, ArchetypeChunk<EntityStore> archetypeChunk, Ref<EntityStore> target, CommandBuffer<EntityStore> commandBuffer, EvaluationContext context)
      Description copied from class: Condition
      Calculates a utility value based on parameters contained within the EvaluationContext. Utility values are normalised between 0 and 1.
      Specified by:
      calculateUtility in class Condition
      Parameters:
      selfIndex - the index of the self entity in the archetype chunk
      archetypeChunk - entity archetype chunk for fetching own components
      target - a ref to the target entity being evaluated
      commandBuffer - command buffer for read-only fetching of other entities components
      context - additional contextual information relating to the option
      Returns:
      a utility value
    • getSimplicity

      public int getSimplicity()
      Description copied from class: Condition
      Returns a value representing the relative simplicity/cost to evaluate the condition, where lower numbers are simpler to compute.
      Specified by:
      getSimplicity in class Condition
      Returns:
      a simplicity value
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Condition