Contents
Class AttitudeView
java.lang.Object
com.hypixel.hytale.server.npc.blackboard.view.PrioritisedProviderView<IAttitudeProvider, AttitudeView>
com.hypixel.hytale.server.npc.blackboard.view.attitude.AttitudeView
- All Implemented Interfaces:
IBlackboardView<AttitudeView>
A singleton blackboard view used entirely to compute the relationship between an NPC and another entity.
Multiple possible providers implementing IAttitudeProvider can be registered with varying levels of priority
in order to allow the computation to be flexibly defined for multiple purposes. Beyond the Attitude
returned, NPCs don't care about the inner workings of these providers.
Examples of providers could include:
- Reputation system
- Local NPC memory
- Evaluation based on player teams
- Evaluation based on other NPC species
-
Nested Class Summary
Nested classes/interfaces inherited from class PrioritisedProviderView
PrioritisedProviderView.PrioritisedProvider<T> -
Field Summary
Fields inherited from class PrioritisedProviderView
LOWEST_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Perform whatever cleanup is necessary in this view at a regular intervalgetAttitude(Ref<EntityStore> ref, int sourceRoleIndex, Ref<EntityStore> target, ComponentAccessor<EntityStore> componentAccessor) getUpdatedView(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) Returns the updated view if the current is outdatedvoidinitialiseEntity(Ref<EntityStore> ref, BlackboardSubscription subscription) Initializes the given entity with any data relevant to the view.booleanisOutdated(Ref<EntityStore> ref, Store<EntityStore> store) Checks whether the current view is outdated for the given NPC and if they need to fetch a new onevoidPerform any final cleanup when the world is removedMethods inherited from class PrioritisedProviderView
registerProvider
-
Constructor Details
-
AttitudeView
-
-
Method Details
-
getAttitude
@Nonnull public Attitude getAttitude(@Nonnull Ref<EntityStore> ref, int sourceRoleIndex, @Nonnull Ref<EntityStore> target, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
isOutdated
Description copied from interface:IBlackboardViewChecks whether the current view is outdated for the given NPC and if they need to fetch a new one- Parameters:
ref- The entity reference of the NPCstore- The entity store for component access- Returns:
- whether they need to query for a new view
-
getUpdatedView
public AttitudeView getUpdatedView(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Description copied from interface:IBlackboardViewReturns the updated view if the current is outdated- Parameters:
ref- The NPC seeking a viewcomponentAccessor- TheComponentAccessorfor component access- Returns:
- the updated view
-
initialiseEntity
public void initialiseEntity(@Nonnull Ref<EntityStore> ref, @Nonnull BlackboardSubscription subscription) Description copied from interface:IBlackboardViewInitializes the given entity with any data relevant to the view.- Parameters:
ref- The entity referencesubscription- TheBlackboardSubscriptionholding the entity's subscribed sets
-
cleanup
public void cleanup()Description copied from interface:IBlackboardViewPerform whatever cleanup is necessary in this view at a regular interval -
onWorldRemoved
public void onWorldRemoved()Description copied from interface:IBlackboardViewPerform any final cleanup when the world is removed
-