Class StateSupport
java.lang.Object
com.hypixel.hytale.server.npc.role.support.StateSupport
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final it.unimi.dsi.fastutil.ints.Int2ObjectMap<it.unimi.dsi.fastutil.ints.IntSet> protected it.unimi.dsi.fastutil.ints.Int2IntMapprotected Map<Ref<EntityStore>, String> protected Set<Ref<EntityStore>> protected Set<Ref<EntityStore>> protected Ref<EntityStore> protected BitSetprotected booleanstatic final intprotected static final ComponentType<EntityStore, NPCEntity> protected final intprotected final intprotected intprotected final StateMappingHelperprotected final StateTransitionControllerprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidaddContextualInteraction(Ref<EntityStore> playerRef, String context) voidaddInteraction(Player player) voidappendStateName(StringBuilder builder) booleanconsumeInteraction(Ref<EntityStore> playerReference) voidflockSetState(Ref<EntityStore> ref, String state, String subState, ComponentAccessor<EntityStore> componentAccessor) intgetStateName(int state, int subState) intbooleanhasContextualInteraction(Ref<EntityStore> playerReference, String context) booleaninState(int state) booleaninState(int state, int subState) booleanbooleaninSubState(int subState) booleanisComponentInState(int componentIndex, int targetState) booleanbooleanbooleanvoidpostRoleBuilt(BuilderSupport builderSupport) voidbooleanrunTransitionActions(Ref<EntityStore> ref, Role role, double dt, Store<EntityStore> store) private voidsendInteractionHintToPlayer(Ref<EntityStore> entityRef, Ref<EntityStore> playerReference, String hint, Store<EntityStore> store) voidsetComponentState(int componentIndex, int targetState) voidsetInteractable(Ref<EntityStore> playerReference, boolean interactable) voidsetInteractable(Ref<EntityStore> entityRef, Ref<EntityStore> playerReference, boolean interactable, String hint, boolean showPrompt, Store<EntityStore> store) voidsetInteractionIterationTarget(Ref<EntityStore> playerReference) voidsetState(int state, int subState, boolean clearOnce, boolean skipTransition) voidsetState(Ref<EntityStore> ref, String state, String subState, ComponentAccessor<EntityStore> componentAccessor) voidsetSubState(String subState) voidupdate(ComponentAccessor<EntityStore> componentAccessor) booleanwillInteractWith(Ref<EntityStore> playerReference)
-
Field Details
-
NO_STATE
public static final int NO_STATE- See Also:
-
NPC_COMPONENT_TYPE
-
stateHelper
-
startState
protected final int startState -
startSubState
protected final int startSubState -
state
protected int state -
subState
protected int subState -
componentLocalStateMachines
protected it.unimi.dsi.fastutil.ints.Int2IntMap componentLocalStateMachines -
localStateMachineAutoResetStates
-
busyStates
protected final it.unimi.dsi.fastutil.ints.Int2ObjectMap<it.unimi.dsi.fastutil.ints.IntSet> busyStates -
missingStates
-
needClearOnce
protected boolean needClearOnce -
interactablePlayers
-
interactedPlayers
-
contextualInteractions
-
interactionIterationTarget
-
stateTransitionController
-
-
Constructor Details
-
StateSupport
-
-
Method Details
-
getStateTransitionController
-
getStateHelper
-
postRoleBuilt
-
update
-
pollNeedClearOnce
public boolean pollNeedClearOnce() -
inState
public boolean inState(int state) -
inSubState
public boolean inSubState(int subState) -
inState
public boolean inState(int state, int subState) -
inState
-
getStateName
-
getStateName
-
getStateIndex
public int getStateIndex() -
getSubStateIndex
public int getSubStateIndex() -
appendStateName
-
setState
public void setState(int state, int subState, boolean clearOnce, boolean skipTransition) -
setState
public void setState(@Nonnull Ref<EntityStore> ref, @Nonnull String state, @Nullable String subState, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
setSubState
-
isComponentInState
public boolean isComponentInState(int componentIndex, int targetState) -
setComponentState
public void setComponentState(int componentIndex, int targetState) -
resetLocalStateMachines
public void resetLocalStateMachines() -
flockSetState
public void flockSetState(Ref<EntityStore> ref, @Nonnull String state, @Nullable String subState, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
isInBusyState
public boolean isInBusyState() -
addContextualInteraction
-
hasContextualInteraction
public boolean hasContextualInteraction(@Nonnull Ref<EntityStore> playerReference, @Nonnull String context) -
addInteraction
-
consumeInteraction
-
setInteractable
-
setInteractable
public void setInteractable(@Nonnull Ref<EntityStore> entityRef, @Nonnull Ref<EntityStore> playerReference, boolean interactable, @Nullable String hint, boolean showPrompt, @Nonnull Store<EntityStore> store) -
sendInteractionHintToPlayer
private void sendInteractionHintToPlayer(@Nonnull Ref<EntityStore> entityRef, @Nonnull Ref<EntityStore> playerReference, @Nonnull String hint, @Nonnull Store<EntityStore> store) -
setInteractionIterationTarget
-
getInteractionIterationTarget
-
willInteractWith
-
runTransitionActions
public boolean runTransitionActions(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, double dt, @Nonnull Store<EntityStore> store) -
isRunningTransitionActions
public boolean isRunningTransitionActions() -
activate
public void activate()
-