Beispiel #1
0
 public bool IsCanTraversal(GraphNode node)
 {
     if (Traversal == null)
     {
         return(true);
     }
     return(Traversal.CanTraverse(null, node));
 }
Beispiel #2
0
        public HashList <GraphNode> CalcConstant()
        {
            float range = CurMovePoint;

            ConstantNodesDraw.Clear();
            ConstantNodesMove.Clear();
            ConstantNodesMove = AStarMgr.GetDistanceRange(SelfBaseUnit.Pos, range, x => Traversal.CanTraverse(null, x));

            foreach (var item in ConstantNodesMove)
            {
                //过滤掉占有单位得节点,并且这个节点不是自身,防止重复绕路
                if (AStarMgr.IsHaveUnit(item))
                {
                    continue;
                }
                ConstantNodesDraw.Add(item);
            }
            return(ConstantNodesDraw);
        }