Package cn.nukkit.entity.ai.route
Class SimpleRouteFinder
java.lang.Object
cn.nukkit.entity.ai.route.SimpleRouteFinder
- All Implemented Interfaces:
IRouteFinder
- Direct Known Subclasses:
ConcurrentRouteFinder
,SimpleFlatAStarRouteFinder
@PowerNukkitXOnly
@Since("1.6.0.0-PNX")
public abstract class SimpleRouteFinder
extends Object
implements IRouteFinder
非异步的路径查找抽象类
在PowerNukkitX的生物AI架构中,不同实体的路径查找是并行的而不是异步的
所以说我们并不需要异步路径查找
在PowerNukkitX的生物AI架构中,不同实体的路径查找是并行的而不是异步的
所以说我们并不需要异步路径查找
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cn.nukkit.entity.ai.route.IRouteFinder
getReachableTarget, getStart, getTarget, isFinished, isInterrupt, isReachable, isSearching, search, setStart, setTarget
-
Field Details
-
nodes
-
currentIndex
protected int currentIndex -
evalPos
-
-
Constructor Details
-
SimpleRouteFinder
-
-
Method Details
-
addNode
-
addNode
-
resetNodes
protected void resetNodes() -
getRoute
Description copied from interface:IRouteFinder
获取寻路结果- Specified by:
getRoute
in interfaceIRouteFinder
- Returns:
- 一个包含
Node
的列表List
,应已排序好,第一项为寻路起点,最后一项为寻路终点,之间的为找到的路径点
-
getCurrentNode
- Specified by:
getCurrentNode
in interfaceIRouteFinder
- Returns:
- 当前索引位置对应的节点
Node
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIRouteFinder
- Returns:
- 是否有下一个节点
Node
-
next
Description copied from interface:IRouteFinder
获取下一个节点Node
(如果有的话)- Specified by:
next
in interfaceIRouteFinder
- Returns:
- 下一个节点
-
hasCurrentNode
public boolean hasCurrentNode()- Specified by:
hasCurrentNode
in interfaceIRouteFinder
- Returns:
- 当前索引所在位置是否有节点
Node
-
getNodeIndex
public int getNodeIndex()- Specified by:
getNodeIndex
in interfaceIRouteFinder
- Returns:
- 当前索引
-
setNodeIndex
public void setNodeIndex(int index) Description copied from interface:IRouteFinder
设置当前索引- Specified by:
setNodeIndex
in interfaceIRouteFinder
- Parameters:
index
- 索引值
-
getNode
- Specified by:
getNode
in interfaceIRouteFinder
- Returns:
- 指定索引位置的节点
Node
-
getNodes
-
getCurrentIndex
public int getCurrentIndex() -
getEvalPos
-