コード例 #1
0
        /// <summary>Provides the next step.</summary>
        /// <remarks>Provides the next step.</remarks>
        /// <param name="plan">the planned route</param>
        /// <param name="fact">
        /// the currently established route, or
        /// <code>null</code> if nothing is established
        /// </param>
        /// <returns>
        /// one of the constants defined in this class, indicating
        /// either the next step to perform, or success, or failure.
        /// 0 is for success, a negative value for failure.
        /// </returns>
        public override int NextStep(RouteInfo plan, RouteInfo fact)
        {
            Args.NotNull(plan, "Planned route");
            int step = Unreachable;

            if ((fact == null) || (fact.GetHopCount() < 1))
            {
                step = FirstStep(plan);
            }
            else
            {
                if (plan.GetHopCount() > 1)
                {
                    step = ProxiedStep(plan, fact);
                }
                else
                {
                    step = DirectStep(plan, fact);
                }
            }
            return(step);
        }
コード例 #2
0
 /// <summary>Provides the next step.</summary>
 /// <remarks>Provides the next step.</remarks>
 /// <param name="plan">the planned route</param>
 /// <param name="fact">
 /// the currently established route, or
 /// <code>null</code> if nothing is established
 /// </param>
 /// <returns>
 /// one of the constants defined in this interface, indicating
 /// either the next step to perform, or success, or failure.
 /// 0 is for success, a negative value for failure.
 /// </returns>
 public abstract int NextStep(RouteInfo plan, RouteInfo fact);
コード例 #3
0
 // nextStep
 /// <summary>Determines the first step to establish a route.</summary>
 /// <remarks>Determines the first step to establish a route.</remarks>
 /// <param name="plan">the planned route</param>
 /// <returns>the first step</returns>
 protected internal virtual int FirstStep(RouteInfo plan)
 {
     return((plan.GetHopCount() > 1) ? ConnectProxy : ConnectTarget);
 }