Contents
Class RandomiserCondition
java.lang.Object
com.hypixel.hytale.server.npc.decisionmaker.core.conditions.base.Condition
com.hypixel.hytale.server.npc.decisionmaker.core.conditions.RandomiserCondition
- All Implemented Interfaces:
JsonAsset<String>, JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, Condition>>
- Since:
- 2021/03/19
-
Field Summary
Fields -
Constructor Summary
Constructors -
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.Methods inherited from class Condition
getAlwaysTrueFor, getAssetMap, getAssetStore, getId, getReference, setupNPC, setupNPC, toString
-
Field Details
-
CODEC
-
-
Constructor Details
-
RandomiserCondition
public RandomiserCondition()
-
-
Method Details
-
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
-