Exemple #1
0
        /// <summary>
        /// Removes a movement node from the nodes list.
        /// </summary>
        /// <param name="node">The movement node to remove.</param>
        /// <returns>The node that was removed. Null if no node was removed.</returns>
        public GenPathNode RemoveNode(GenPathNode node)
        {
            if (Nodes.Remove(node))
                return node;

            return null;
        }
Exemple #2
0
        /// <summary>
        /// Adds a movement node to the nodes list for use in the path.
        /// </summary>
        /// <param name="node">The movement node to add.</param>
        /// <returns>The node that was added.</returns>
        public GenPathNode AddNode(GenPathNode node)
        {
            Nodes.Add(node);

            return node;
        }
Exemple #3
0
        /// <summary>
        /// Adds a movement node at the specified index in the nodes list for use in the path.
        /// </summary>
        /// <param name="node">The movement node to add.</param>
        /// <param name="index">The index number in the nodes list.</param>
        /// <returns>The node that was added. Null if the index was outside of the bounds of the nodes list.</returns>
        public GenPathNode AddNodeAt(GenPathNode node, int index)
        {
            if ((index < 0) || (index > Nodes.Count))
                return null;

            Nodes.Insert(index, node);

            return node;
        }