Example #1
0
        /// <summary>
        /// Returns whether this <see cref="GridVertex"/> is traversable with the given motility.
        /// </summary>
        /// <remarks>
        /// A <see cref="GridVertex"/> also checks with its protruding edges and touching nodes, as any of them can also
        /// prohibit movement through a corner. If any of them return false, then this method returns false.
        /// </remarks>
        /// <param name="motility">The agent's motility</param>
        /// <returns><c>true</c> if the agent is capable of traversing this edge with one (or more) of its motilities.</returns>
        public bool IsTraversable(Motility motility)
        {
            throw new System.NotImplementedException();

            // checks internal motility and the motility of its protruding edges and touching nodes
            // if the vertex has 'Motility.Unconstrained' set then it does not explicitly block any movement
        }
Example #2
0
        public bool IsTraversable(Motility motility)
        {
            // TODO: Check its own internal motility (based on if an object is on the edge)

            // TODO: Ask both of its joining nodes if they are traversable.

            throw new System.NotImplementedException();
        }
Example #3
0
 public GridEdge(float weight, Motility motility, Vec2 position, Direction annotation)
 {
     Weight   = weight;
     Motility = motility;
     //Position = position;
     //Annotation = annotation;
     Location = new GridPoint(position, annotation);
 }
Example #4
0
        public virtual bool CanEnter(Motility motility, PathfindingNode <T> neighbor)
        {
            throw new System.NotImplementedException();

            // Check internal motility

            // Check motility of edge connecting this and neighbor
        }
Example #5
0
        /// <summary>
        /// Returns whether this <see cref="GridEdge"/> is traversable with the given motility.
        /// </summary>
        /// <param name="motility">The agent's motility</param>
        /// <returns><c>true</c> if the agent is capable of traversing this edge with one (or more) of its motilities.</returns>
        public bool IsTraversable(Motility motility)
        {
            // NOTE: Checks internal motility only

            // if the edge has 'Motility.Unconstrained' set then it does not explicitly block any movement
            if (Motility == Motility.Unconstrained)
            {
                return(true);
            }

            return(motility.Contains(Motility));
        }
Example #6
0
 public bool CanTraverse(Motility motility)
 {
     throw new System.NotImplementedException();
 }
Example #7
0
        }                       // The thing the node represents

        public PathfindingNode(T value, Motility motility)
        {
            Motility = motility;
            Value    = value;
        }
Example #8
0
        public virtual bool IsTraversable(Motility motility)
        {
            throw new System.NotImplementedException();

            // Check internal motility
        }
Example #9
0
 public PathfindingEdge(T value, float weight, Motility motility)
 {
     Motility = motility;
     Weight   = weight;
     Value    = value;
 }
Example #10
0
 public GridVertex(float weight, Motility motility, Vec2 position)
 {
     Weight   = weight;
     Motility = motility;
     Location = new GridPoint(position, Direction.NW);
 }
Example #11
0
 public void UnsetMotilityFlag(Motility motility)
 {
     _motility -= motility;
 }
Example #12
0
 public void SetMotilityFlag(Motility motility)
 {
     _motility |= motility;
 }
Example #13
0
 public bool IsTraversable(Motility motility)
 {
     return(_motility.Contains(motility));
 }