Interface IBehaviorGroup
- All Known Implementing Classes:
BehaviorGroup
,EmptyBehaviorGroup
它由若干个(核心)行为
IBehavior
、控制器IController
、传感器ISensor
以及一个寻路器IRouteFinder
和记忆存储器IMemoryStorage
组成br>
注:核心行为指的是不会被行为优先级影响的行为,其激活状态只取决于其自身的评估器br>
A Behavior Group is a basic, self-contained unit of AI
that consists of several (core) BehaviorsIBehavior
, ControllersIController
, SensorsISensor
and a PathfinderIRouteFinder
and memory IMemoryStorage
are composed
Note: Core behavior refers to the behavior that will not be affected by the priority of the behavior, and its activation status only depends on its own evaluator
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyController
(EntityIntelligent entity) 应用行为内部所有的控制器IController
void
collectSensorData
(EntityIntelligent entity) 调用行为组内部的所有传感器ISensor
,并将传感器返回的记忆数据写入到记忆存储器中IMemoryStorage
default void
debugTick
(EntityIntelligent entity) 当 EntityAI.checkDebugOption(BEHAVIOR) == true 时此方法每1gt调用一次,用于debug模式相关内容的刷新void
evaluateBehaviors
(EntityIntelligent entity) 调用行为组内部的所有行为IBehavior
的评估器IBehaviorEvaluator
void
调用行为组内部的所有核心行为IBehavior
的评估器IBehaviorEvaluator
boolean
default void
save
(EntityIntelligent entity) void
setForceUpdateRoute
(boolean forceUpdateRoute) 要求下一gt立即更新路径void
调用行为组内部所有被激活的行为IBehavior
的执行器IBehaviorExecutor
void
调用行为组内部所有被激活的核心行为IBehavior
的执行器IBehaviorExecutor
void
updateRoute
(EntityIntelligent entity) 通过行为组使用的寻路器更新当前位置到目标位置路径
-
Method Details
-
evaluateBehaviors
调用行为组内部的所有行为IBehavior
的评估器IBehaviorEvaluator
Call the evaluator
IBehaviorEvaluator
of all behaviorIBehavior
inside the behavior group- Parameters:
entity
- 目标实体对象
-
evaluateCoreBehaviors
调用行为组内部的所有核心行为IBehavior
的评估器IBehaviorEvaluator
Call the evaluator
IBehaviorEvaluator
of all core behaviorIBehavior
inside the behavior group- Parameters:
entity
- 目标实体对象
-
collectSensorData
调用行为组内部的所有传感器ISensor
,并将传感器返回的记忆数据写入到记忆存储器中IMemoryStorage
Call all sensors
ISensor
inside the behavior group, and write the memory data returned by the sensor to the memory storageIMemoryStorage
- Parameters:
entity
- 目标实体对象
-
tickRunningBehaviors
调用行为组内部所有被激活的行为IBehavior
的执行器IBehaviorExecutor
Call the executor
IBehaviorExecutor
of all activated behaviorIBehavior
inside the behavior group- Parameters:
entity
- 目标实体对象
-
tickRunningCoreBehaviors
调用行为组内部所有被激活的核心行为IBehavior
的执行器IBehaviorExecutor
Call the executor
IBehaviorExecutor
of all activated core behaviorIBehavior
inside the behavior group- Parameters:
entity
- 目标实体对象
-
applyController
应用行为内部所有的控制器IController
All controllers inside the application behavior
IController
- Parameters:
entity
- 目标实体对象
-
getBehaviors
-
getCoreBehaviors
-
getRunningBehaviors
-
getRunningCoreBehaviors
-
getSensors
-
getControllers
Set<IController> getControllers()- Returns:
- 行为组包含的控制器
IController
Behavior group contains the controllerIController
-
getRouteFinder
IRouteFinder getRouteFinder()- Returns:
- 行为组使用的寻路器
IRouteFinder
Routefinder used by behavior groupsIRouteFinder
-
updateRoute
通过行为组使用的寻路器更新当前位置到目标位置路径Update the path from the current position to the target position through the pathfinder used by the behavior group
- Parameters:
entity
- 目标实体
-
getMemoryStorage
IMemoryStorage getMemoryStorage()- Returns:
- 行为组的记忆存储器
IMemoryStorage
Behavior Group Memory StorageIMemoryStorage
-
isForceUpdateRoute
boolean isForceUpdateRoute()- Returns:
- 下一gt是否强制更新路径
Whether the next gt is forced to update the path
-
setForceUpdateRoute
void setForceUpdateRoute(boolean forceUpdateRoute) 要求下一gt立即更新路径Ask the next gt to update the path immediately
- Parameters:
forceUpdateRoute
- 立即更新路径
-
debugTick
当 EntityAI.checkDebugOption(BEHAVIOR) == true 时此方法每1gt调用一次,用于debug模式相关内容的刷新When EntityAI.checkDebugOption(BEHAVIOR) == true, this method is called every 1gt to refresh the content related to debug mode
-
save
-