/// <summary>Stops pathfinding for the players that are pathfinding using the specified pathmap reference.</summary>
 /// <param name="actionSet">The actionset of the current rule.</param>
 /// <param name="pathmapReference">The reference of the pathmap. Any players using this pathmap will stop pathfinding.</param>
 /// <param name="players">The players to stop pathfinding for.</param>
 public void StopPathfindingWithPathmap(ActionSet actionSet, Element pathmapReference, Element players) =>
 StopPathfinding(
     actionSet,
     // Filter players by whos pathfinding reference is equal to pathmapReference.
     Element.Part <V_FilteredArray>(
         players,
         new V_Compare(
             PathmapReference.GetVariable(new V_ArrayElement()),
             Operators.Equal,
             pathmapReference
             )
         )
     );
Exemplo n.º 2
0
 /// <summary>Stops pathfinding for the players that are pathfinding using the specified pathmap reference.</summary>
 /// <param name="actionSet">The actionset of the current rule.</param>
 /// <param name="pathmapReference">The reference of the pathmap. Any players using this pathmap will stop pathfinding.</param>
 /// <param name="players">The players to stop pathfinding for.</param>
 public void StopPathfindingWithPathmap(ActionSet actionSet, Element pathmapReference, Element players) =>
 StopPathfinding(
     actionSet,
     // Filter players by whos pathfinding reference is equal to pathmapReference.
     Element.Filter(
         players,
         Element.Compare(
             PathmapReference.GetVariable(Element.ArrayElement()),
             Operator.Equal,
             pathmapReference
             )
         )
     );
        /// <summary>Gets the closest node from a position.</summary>
        public Element ClosestNode(ActionSet actionSet, Element position)
        {
            // Get the nodes in the pathmap
            Element nodes = Element.Part <V_ValueInArray>(PathmapInstance.Nodes.GetVariable(), PathmapReference.GetVariable());

            // Get the closest node index.
            if (ApplicableNodeDeterminer == null)
            {
                return(DijkstraBase.ClosestNodeToPosition(nodes, position, PotentiallyNullNodes));
            }
            else
            {
                return((Element)ApplicableNodeDeterminer.Invoke(actionSet, nodes, position));
            }
        }