コード例 #1
0
        /// <summary>
        /// Gets next waypoint of a certain type ignoring certain waypoints
        /// </summary>
        /// <param name="w1"></param>
        /// <param name="wt"></param>
        /// <param name="ignorable"></param>
        /// <returns></returns>
        public ArbiterWaypoint GetNext(ArbiterWaypoint w1, List <WaypointType> wts, List <ArbiterWaypoint> ignorable)
        {
            ArbiterWaypoint tmp = w1;

            while (tmp != null)
            {
                bool back = false;
                foreach (WaypointType wt in wts)
                {
                    if (tmp.WaypointTypeEquals(wt))
                    {
                        back = true;
                    }
                }

                if (back && !ignorable.Contains(tmp))
                {
                    return(tmp);
                }
                if (tmp.NextPartition != null)
                {
                    tmp = tmp.NextPartition.Final;
                }
                else
                {
                    tmp = null;
                }
            }

            return(null);
        }
コード例 #2
0
        /// <summary>
        /// Gets next waypoint of a certain type ignoring certain waypoints
        /// </summary>
        /// <param name="w1"></param>
        /// <param name="wt"></param>
        /// <param name="ignorable"></param>
        /// <returns></returns>
        public ArbiterWaypoint GetNext(ArbiterWaypoint w1, WaypointType wt, List <ArbiterWaypoint> ignorable)
        {
            ArbiterWaypoint tmp = w1;

            while (tmp != null)
            {
                if (tmp.WaypointTypeEquals(wt) && !ignorable.Contains(tmp))
                {
                    return(tmp);
                }
                if (tmp.NextPartition != null)
                {
                    tmp = tmp.NextPartition.Final;
                }
                else
                {
                    tmp = null;
                }
            }

            return(null);
        }
コード例 #3
0
        /// <summary>
        /// Get the next waypoint of a certain type
        /// </summary>
        /// <param name="w1">Starting waypoint of search</param>
        /// <param name="wt">Waypoint type to look for</param>
        /// <returns></returns>
        public ArbiterWaypoint GetNext(ArbiterWaypoint w1, WaypointType wt)
        {
            ArbiterWaypoint tmp = w1;

            while (tmp != null)
            {
                if (tmp.WaypointTypeEquals(wt))
                {
                    return(tmp);
                }

                if (tmp.NextPartition != null)
                {
                    tmp = tmp.NextPartition.Final;
                }
                else
                {
                    tmp = null;
                }
            }

            return(null);
        }