Class StateMappingHelper

java.lang.Object
com.hypixel.hytale.server.npc.asset.builder.StateMappingHelper

public class StateMappingHelper extends Object
  • Field Details

    • DEFAULT_STATE

      public static final String DEFAULT_STATE
      See Also:
    • DEFAULT_SUB_STATE

      public static final String DEFAULT_SUB_STATE
      See Also:
    • DEFAULT_STATE_PARAMETER

      public static final String DEFAULT_STATE_PARAMETER
      See Also:
    • STATE_CHANGE_RESET_PARAMETER

      public static final String STATE_CHANGE_RESET_PARAMETER
      See Also:
    • mainStateMap

      @Nullable private StateMappingHelper.StateMap mainStateMap
    • allMainStates

      private int[] allMainStates
    • subStateMap

      @Nullable private it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<StateMappingHelper.IStateMap> subStateMap
    • depth

      private int depth
    • currentParentState

      @Nullable private ArrayDeque<StateMappingHelper.StateDepth> currentParentState
    • component

      private boolean component
    • hasStateEvaluator

      private boolean hasStateEvaluator
    • requiresStateEvaluator

      private boolean requiresStateEvaluator
    • defaultSubState

      private String defaultSubState
    • defaultComponentLocalState

      private String defaultComponentLocalState
    • defaultComponentLocalStateIndex

      private int defaultComponentLocalStateIndex
    • componentLocalStateAutoReset

      private boolean componentLocalStateAutoReset
    • componentImportStateMappings

      private it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<String> componentImportStateMappings
    • singletonDefaultStateMap

      private StateMappingHelper.SingletonStateMap singletonDefaultStateMap
  • Constructor Details

    • StateMappingHelper

      public StateMappingHelper()
  • Method Details

    • getAllMainStates

      public int[] getAllMainStates()
    • getHighestSubStateIndex

      public int getHighestSubStateIndex(int mainStateIndex)
    • getAndPutSensorIndex

      public void getAndPutSensorIndex(String state, String subState, @Nonnull BiConsumer<Integer,Integer> setter)
    • getAndPutSetterIndex

      public void getAndPutSetterIndex(String state, String subState, @Nonnull BiConsumer<Integer,Integer> setter)
    • getAndPutStateRequirerIndex

      public void getAndPutStateRequirerIndex(String state, String subState, @Nonnull BiConsumer<Integer,Integer> setter)
    • getAndPutIndex

      private void getAndPutIndex(String state, @Nullable String subState, @Nonnull BiConsumer<Integer,Integer> setter, @Nonnull Function<String,Integer> mainStateFunction, @Nonnull BiFunction<Integer,String,Integer> subStateFunction)
    • initialiseDefaultSubStates

      @Nonnull private StateMappingHelper.IStateMap initialiseDefaultSubStates(int index)
    • validate

      public void validate(String configName, @Nonnull List<String> errors)
    • getStateIndex

      public int getStateIndex(String state)
    • getSubStateIndex

      public int getSubStateIndex(int index, String subState)
    • getStateName

      public String getStateName(int index)
    • getSubStateName

      public String getSubStateName(int index, int subState)
    • getCurrentParentState

      @Nullable public String getCurrentParentState()
    • increaseDepth

      public void increaseDepth()
    • decreaseDepth

      public void decreaseDepth()
    • setDefaultSubState

      public void setDefaultSubState(String subState)
    • getDefaultSubState

      public String getDefaultSubState()
    • setNotComponent

      public void setNotComponent()
    • isComponent

      public boolean isComponent()
    • hasComponentStates

      public boolean hasComponentStates()
    • initialiseComponentState

      public void initialiseComponentState(@Nonnull BuilderSupport support)
    • popComponentState

      public void popComponentState(@Nonnull BuilderSupport support)
    • readComponentDefaultLocalState

      public void readComponentDefaultLocalState(@Nonnull com.google.gson.JsonObject data)
    • hasDefaultLocalState

      public boolean hasDefaultLocalState()
    • getDefaultLocalState

      public String getDefaultLocalState()
    • setComponentImportStateMappings

      public void setComponentImportStateMappings(@Nonnull com.google.gson.JsonArray states)
    • getComponentImportStateIndex

      public int getComponentImportStateIndex(String state)
    • importedStateCount

      public int importedStateCount()
    • setRequiresStateEvaluator

      public void setRequiresStateEvaluator()
    • setHasStateEvaluator

      public void setHasStateEvaluator()
    • optimise

      public void optimise()