Class WeightedAction
java.lang.Object
com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
com.hypixel.hytale.server.npc.corecomponents.WeightedAction
- All Implemented Interfaces:
Action,RoleStateChange,IAnnotatedComponent,IComponentExecutionControl
-
Field Summary
FieldsFields inherited from class com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
index, parentFields inherited from interface com.hypixel.hytale.server.npc.instructions.Action
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(Role role, InfoProvider infoProvider) booleancanExecute(Ref<EntityStore> ref, Role role, InfoProvider sensorInfo, double dt, Store<EntityStore> store) voidvoiddeactivate(Role role, InfoProvider infoProvider) booleanexecute(Ref<EntityStore> ref, Role role, InfoProvider sensorInfo, double dt, Store<EntityStore> store) voidgetInfo(Role role, ComponentInfo holder) doublebooleanbooleanvoidvoidmotionControllerChanged(Ref<EntityStore> ref, NPCEntity npcComponent, com.hypixel.hytale.server.npc.movement.controllers.MotionController motionController, ComponentAccessor<EntityStore> componentAccessor) booleanprocessDelay(float dt) voidregisterWithSupport(Role role) voidvoidsetOnce()voidvoidteleported(Role role, World from, World to) voidMethods inherited from class com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
getIndex, getParent, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hypixel.hytale.server.npc.util.IAnnotatedComponent
getBreadCrumbs, getBreadCrumbs, getIndex, getLabel, getParent, setContext
-
Field Details
-
action
-
weight
private final double weight
-
-
Constructor Details
-
WeightedAction
-
-
Method Details
-
getWeight
public double getWeight() -
canExecute
public boolean canExecute(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store) - Specified by:
canExecutein interfaceAction
-
execute
public boolean execute(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store) -
activate
-
deactivate
- Specified by:
deactivatein interfaceAction
-
isActivated
public boolean isActivated()- Specified by:
isActivatedin interfaceAction
-
getInfo
- Specified by:
getInfoin interfaceIAnnotatedComponent- Overrides:
getInfoin classAnnotatedComponentBase
-
processDelay
public boolean processDelay(float dt) - Specified by:
processDelayin interfaceIComponentExecutionControl
-
clearOnce
public void clearOnce()- Specified by:
clearOncein interfaceIComponentExecutionControl
-
setOnce
public void setOnce()- Specified by:
setOncein interfaceIComponentExecutionControl
-
isTriggered
public boolean isTriggered()- Specified by:
isTriggeredin interfaceIComponentExecutionControl
-
registerWithSupport
- Specified by:
registerWithSupportin interfaceRoleStateChange
-
motionControllerChanged
public void motionControllerChanged(@Nullable Ref<EntityStore> ref, @Nonnull NPCEntity npcComponent, com.hypixel.hytale.server.npc.movement.controllers.MotionController motionController, @Nullable ComponentAccessor<EntityStore> componentAccessor) - Specified by:
motionControllerChangedin interfaceRoleStateChange
-
loaded
- Specified by:
loadedin interfaceRoleStateChange
-
spawned
- Specified by:
spawnedin interfaceRoleStateChange
-
unloaded
- Specified by:
unloadedin interfaceRoleStateChange
-
removed
- Specified by:
removedin interfaceRoleStateChange
-
teleported
- Specified by:
teleportedin interfaceRoleStateChange
-