Contents
Class ScaledCurveCondition
java.lang.Object
com.hypixel.hytale.server.npc.decisionmaker.core.conditions.base.Condition
com.hypixel.hytale.server.npc.decisionmaker.core.conditions.base.ScaledCurveCondition
- All Implemented Interfaces:
JsonAsset<String>, JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, Condition>>
- Direct Known Subclasses:
FlockSizeCondition, NearbyCountCondition, SelfStatAbsoluteCondition, SustainedDamageCondition, TargetDistanceCondition, TargetMemoryCountCondition, TargetStatAbsoluteCondition, TimeOfDayCondition, TimeSinceLastUsedCondition
Evaluates a value within a scaled non-percentage-based range against a
ScaledResponseCurve and returns the corresponding value from the y-axis.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculateUtility(int selfIndex, ArchetypeChunk<EntityStore> archetypeChunk, Ref<EntityStore> target, CommandBuffer<EntityStore> commandBuffer, EvaluationContext context) Calculates a utility value based on parameters contained within the EvaluationContext.intReturns a value representing the relative simplicity/cost to evaluate the condition, where lower numbers are simpler to compute.toString()Methods inherited from class Condition
getAlwaysTrueFor, getAssetMap, getAssetStore, getId, getReference, setupNPC, setupNPC
-
Field Details
-
ABSTRACT_CODEC
-
-
Method Details
-
getResponseCurve
-
calculateUtility
public double calculateUtility(int selfIndex, ArchetypeChunk<EntityStore> archetypeChunk, Ref<EntityStore> target, CommandBuffer<EntityStore> commandBuffer, EvaluationContext context) Description copied from class:ConditionCalculates a utility value based on parameters contained within the EvaluationContext. Utility values are normalised between 0 and 1.- Specified by:
calculateUtilityin classCondition- Parameters:
selfIndex- the index of the self entity in the archetype chunkarchetypeChunk- entity archetype chunk for fetching own componentstarget- a ref to the target entity being evaluatedcommandBuffer- command buffer for read-only fetching of other entities componentscontext- additional contextual information relating to the option- Returns:
- a utility value
-
getSimplicity
public int getSimplicity()Description copied from class:ConditionReturns a value representing the relative simplicity/cost to evaluate the condition, where lower numbers are simpler to compute.- Specified by:
getSimplicityin classCondition- Returns:
- a simplicity value
-
toString
-