StateSupport

public class StateSupport

Class StateSupport. Provides statesupport functionality for the Hytale server.

java.lang.Object > StateSupport

Field Summary

state

protected int state

Field state.

subState

protected int subState

Field subState.

componentLocalStateMachines

protected Int2IntMap componentLocalStateMachines

Field componentLocalStateMachines.

localStateMachineAutoResetStates

protected BitSet localStateMachineAutoResetStates

Field localStateMachineAutoResetStates.

needClearOnce

protected boolean needClearOnce

Field needClearOnce.

interactablePlayers

protected Set> interactablePlayers

Field interactablePlayers.

interactedPlayers

protected Set> interactedPlayers

Field interactedPlayers.

interactionIterationTarget

protected Ref interactionIterationTarget

Field interactionIterationTarget.

defaultSubState

final String defaultSubState

Field defaultSubState.

defaultSubStateIndex

final int defaultSubStateIndex

Field defaultSubStateIndex.

it

final Iterator> it

Field it.

ref

final Ref ref

Field ref.

playerComponent

final Player playerComponent

Field playerComponent.

playerSettingsComponent

final PlayerSettings playerSettingsComponent

Field playerSettingsComponent.

ret

final boolean ret

Field ret.

stateIndex

final int stateIndex

Field stateIndex.

subStateIndex

final int subStateIndex

Field subStateIndex.

oldState

final int oldState

Field oldState.

index

final int index

Field index.

npcComponent

final NPCEntity npcComponent

Field npcComponent.

flockReference

final Ref flockReference

Field flockReference.

entityGroupComponent

final EntityGroup entityGroupComponent

Field entityGroupComponent.

memberStore

final Store memberStore

Field memberStore.

busySubStates

final IntSet busySubStates

Field busySubStates.

contextualInteraction

final String contextualInteraction

Field contextualInteraction.

wasInteractable

final boolean wasInteractable

Field wasInteractable.

hasComponent

final boolean hasComponent

Field hasComponent.

viewerComponent

final EntityTrackerSystems.EntityViewer viewerComponent

Field viewerComponent.

update

final ComponentUpdate update

Field update.

Method Detail

StateSupport

public public StateSupport (@Nonnull final BuilderRole builder, @Nonnull final BuilderSupport support)

Method StateSupport.

Parameters:
@Nonnull final BuilderRole builder
@Nonnull final BuilderSupport support

getStateTransitionController

public StateTransitionController getStateTransitionController ()

Method getStateTransitionController.

getStateHelper

public StateMappingHelper getStateHelper ()

Method getStateHelper.

postRoleBuilt

public void postRoleBuilt (@Nonnull final BuilderSupport builderSupport)

Method postRoleBuilt.

Parameters:
@Nonnull final BuilderSupport builderSupport

update

public void update (@Nonnull final ComponentAccessor componentAccessor)

Method update.

Parameters:
@Nonnull final ComponentAccessor componentAccessor

pollNeedClearOnce

public boolean pollNeedClearOnce ()

Method pollNeedClearOnce.

inState

public boolean inState (final int state)

Method inState.

Parameters:
final int state

inSubState

public boolean inSubState (final int subState)

Method inSubState.

Parameters:
final int subState

getStateName

public String getStateName ()

Method getStateName.

getStateIndex

public int getStateIndex ()

Method getStateIndex.

getSubStateIndex

public int getSubStateIndex ()

Method getSubStateIndex.

appendStateName

public void appendStateName (@Nonnull final StringBuilder builder)

Method appendStateName.

Parameters:
@Nonnull final StringBuilder builder

setState

public void setState (final int state, final int subState, final boolean clearOnce, final boolean skipTransition)

Method setState.

Parameters:
final int state
final int subState
final boolean clearOnce
final boolean skipTransition

setSubState

public void setSubState (final String subState)

Method setSubState.

Parameters:
final String subState

isComponentInState

public boolean isComponentInState (final int componentIndex, final int targetState)

Method isComponentInState.

Parameters:
final int componentIndex
final int targetState

setComponentState

public void setComponentState (final int componentIndex, final int targetState)

Method setComponentState.

Parameters:
final int componentIndex
final int targetState

resetLocalStateMachines

public void resetLocalStateMachines ()

Method resetLocalStateMachines.

flockSetState

public void flockSetState (final Ref ref, @Nonnull final String state, @Nullable final String subState, @Nonnull final ComponentAccessor componentAccessor)

Method flockSetState.

Parameters:
final Ref ref
@Nonnull final String state
@Nullable final String subState
@Nonnull final ComponentAccessor componentAccessor

isInBusyState

public boolean isInBusyState ()

Method isInBusyState.

addContextualInteraction

public void addContextualInteraction (@Nonnull final Ref playerRef, @Nonnull final String context)

Method addContextualInteraction.

Parameters:
@Nonnull final Ref playerRef
@Nonnull final String context

hasContextualInteraction

public boolean hasContextualInteraction (@Nonnull final Ref playerReference, @Nonnull final String context)

Method hasContextualInteraction.

Parameters:
@Nonnull final Ref playerReference
@Nonnull final String context

addInteraction

public void addInteraction (@Nonnull final Player player)

Method addInteraction.

Parameters:
@Nonnull final Player player

consumeInteraction

public boolean consumeInteraction (@Nonnull final Ref playerReference)

Method consumeInteraction.

Parameters:
@Nonnull final Ref playerReference

setInteractable

public void setInteractable (@Nonnull final Ref playerReference, final boolean interactable)

Method setInteractable.

Parameters:
@Nonnull final Ref playerReference
final boolean interactable

if

public else if (hasComponent && this.interactablePlayers.isEmpty()

Method if.

Parameters:
hasComponent && this.interactablePlayers.isEmpty(

sendInteractionHintToPlayer

private void sendInteractionHintToPlayer (@Nonnull final Ref entityRef, @Nonnull final Ref playerReference, @Nonnull final String hint, @Nonnull final Store store)

Method sendInteractionHintToPlayer.

Parameters:
@Nonnull final Ref entityRef
@Nonnull final Ref playerReference
@Nonnull final String hint
@Nonnull final Store store

setInteractionIterationTarget

public void setInteractionIterationTarget (@Nullable final Ref playerReference)

Method setInteractionIterationTarget.

Parameters:
@Nullable final Ref playerReference

getInteractionIterationTarget

public Ref getInteractionIterationTarget ()

Method getInteractionIterationTarget.

willInteractWith

public boolean willInteractWith (@Nonnull final Ref playerReference)

Method willInteractWith.

Parameters:
@Nonnull final Ref playerReference

runTransitionActions

public boolean runTransitionActions (@Nonnull final Ref ref, @Nonnull final Role role, final double dt, @Nonnull final Store store)

Method runTransitionActions.

Parameters:
@Nonnull final Ref ref
@Nonnull final Role role
final double dt
@Nonnull final Store store

isRunningTransitionActions

public boolean isRunningTransitionActions ()

Method isRunningTransitionActions.

activate

public void activate ()

Method activate.