StateMappingHelper

public class StateMappingHelper

Class StateMappingHelper. Provides statemappinghelper functionality for the Hytale server.

java.lang.Object > StateMappingHelper

Field Summary

mainStateMap

private StateMap mainStateMap

Field mainStateMap.

allMainStates

private int[] allMainStates

Field allMainStates.

subStateMap

private Int2ObjectOpenHashMap subStateMap

Field subStateMap.

depth

private int depth

Field depth.

currentParentState

private ArrayDeque currentParentState

Field currentParentState.

component

private boolean component

Field component.

hasStateEvaluator

private boolean hasStateEvaluator

Field hasStateEvaluator.

requiresStateEvaluator

private boolean requiresStateEvaluator

Field requiresStateEvaluator.

defaultSubState

private String defaultSubState

Field defaultSubState.

defaultComponentLocalState

private String defaultComponentLocalState

Field defaultComponentLocalState.

defaultComponentLocalStateIndex

private int defaultComponentLocalStateIndex

Field defaultComponentLocalStateIndex.

componentLocalStateAutoReset

private boolean componentLocalStateAutoReset

Field componentLocalStateAutoReset.

componentImportStateMappings

private Object2IntOpenHashMap componentImportStateMappings

Field componentImportStateMappings.

singletonDefaultStateMap

private SingletonStateMap singletonDefaultStateMap

Field singletonDefaultStateMap.

helper

final IStateMap helper

Field helper.

index

final Integer index

Field index.

subStateIndex

final Integer subStateIndex

Field subStateIndex.

map

final StateMap map

Field map.

state

final String state

Field state.

validator

final StateStringValidator validator

Field validator.

resetValue

final JsonElement resetValue

Field resetValue.

string

final String string

Field string.

iterator

final ObjectIterator> iterator

Field iterator.

next

final Int2ObjectMap.Entry next

Field next.

stateIndexSource

private int stateIndexSource

Field stateIndexSource.

stateSensors

private BitSet stateSensors

Field stateSensors.

stateSetters

private BitSet stateSetters

Field stateSetters.

stateRequirers

private BitSet stateRequirers

Field stateRequirers.

Method Detail

StateMappingHelper

public public StateMappingHelper ()

Method StateMappingHelper.

getAllMainStates

public int[] getAllMainStates ()

Method getAllMainStates.

getHighestSubStateIndex

public int getHighestSubStateIndex (final int mainStateIndex)

Method getHighestSubStateIndex.

Parameters:
final int mainStateIndex

getAndPutSensorIndex

public void getAndPutSensorIndex (final String state, final String subState, @Nonnull final BiConsumer setter)

Method getAndPutSensorIndex.

Parameters:
final String state
final String subState
@Nonnull final BiConsumer setter

StateDepth

public new StateDepth (this.depth, state)

Method StateDepth.

Parameters:
this.depth this.depth
state state

getAndPutSetterIndex

public void getAndPutSetterIndex (final String state, final String subState, @Nonnull final BiConsumer setter)

Method getAndPutSetterIndex.

Parameters:
final String state
final String subState
@Nonnull final BiConsumer setter

getAndPutStateRequirerIndex

public void getAndPutStateRequirerIndex (final String state, final String subState, @Nonnull final BiConsumer setter)

Method getAndPutStateRequirerIndex.

Parameters:
final String state
final String subState
@Nonnull final BiConsumer setter

getAndPutIndex

private void getAndPutIndex (final String state, @Nullable final String subState, @Nonnull final BiConsumer setter, @Nonnull final Function mainStateFunction, @Nonnull final BiFunction subStateFunction)

Method getAndPutIndex.

Parameters:
final String state
@Nullable final String subState
@Nonnull final BiConsumer setter
@Nonnull final Function mainStateFunction
@Nonnull final BiFunction subStateFunction

initialiseDefaultSubStates

private IStateMap initialiseDefaultSubStates (final int index)

Method initialiseDefaultSubStates.

Parameters:
final int index

validate

public void validate (final String configName, @Nonnull final List errors)

Method validate.

Parameters:
final String configName
@Nonnull final List errors

getStateIndex

public int getStateIndex (final String state)

Method getStateIndex.

Parameters:
final String state

getSubStateIndex

public int getSubStateIndex (final int index, final String subState)

Method getSubStateIndex.

Parameters:
final int index
final String subState

getStateName

public String getStateName (final int index)

Method getStateName.

Parameters:
final int index

getSubStateName

public String getSubStateName (final int index, final int subState)

Method getSubStateName.

Parameters:
final int index
final int subState

getCurrentParentState

public String getCurrentParentState ()

Method getCurrentParentState.

increaseDepth

public void increaseDepth ()

Method increaseDepth.

decreaseDepth

public void decreaseDepth ()

Method decreaseDepth.

setDefaultSubState

public void setDefaultSubState (final String subState)

Method setDefaultSubState.

Parameters:
final String subState

getDefaultSubState

public String getDefaultSubState ()

Method getDefaultSubState.

setNotComponent

public void setNotComponent ()

Method setNotComponent.

isComponent

public boolean isComponent ()

Method isComponent.

hasComponentStates

public boolean hasComponentStates ()

Method hasComponentStates.

initialiseComponentState

public void initialiseComponentState (@Nonnull final BuilderSupport support)

Method initialiseComponentState.

Parameters:
@Nonnull final BuilderSupport support

popComponentState

public void popComponentState (@Nonnull final BuilderSupport support)

Method popComponentState.

Parameters:
@Nonnull final BuilderSupport support

readComponentDefaultLocalState

public void readComponentDefaultLocalState (@Nonnull final JsonObject data)

Method readComponentDefaultLocalState.

Parameters:
@Nonnull final JsonObject data

IllegalStateException

public new IllegalStateException (validator.errorMessage(state)

Method IllegalStateException.

Parameters:
validator.errorMessage(state validator.errorMessage(state

hasDefaultLocalState

public boolean hasDefaultLocalState ()

Method hasDefaultLocalState.

getDefaultLocalState

public String getDefaultLocalState ()

Method getDefaultLocalState.

setComponentImportStateMappings

public void setComponentImportStateMappings (@Nonnull final JsonArray states)

Method setComponentImportStateMappings.

Parameters:
@Nonnull final JsonArray states

getComponentImportStateIndex

public int getComponentImportStateIndex (final String state)

Method getComponentImportStateIndex.

Parameters:
final String state

importedStateCount

public int importedStateCount ()

Method importedStateCount.

setRequiresStateEvaluator

public void setRequiresStateEvaluator ()

Method setRequiresStateEvaluator.

setHasStateEvaluator

public void setHasStateEvaluator ()

Method setHasStateEvaluator.

optimise

public void optimise ()

Method optimise.

getOrCreateIndex

private int getOrCreateIndex (final String name)

Method getOrCreateIndex.

Parameters:
final String name

getAndPutRequirerIndex

public int getAndPutRequirerIndex (final String targetState)

Method getAndPutRequirerIndex.

Parameters:
final String targetState

isEmpty

public boolean isEmpty ()

Method isEmpty.

size

public int size ()

Method size.