/// <summary>
        /// Look for all partial routes that are an extension of the initial partial route.
        /// </summary>
        private static IEnumerable <PartialRoute> FindNextStep(IRailway railway, PartialRoute initial)
        {
            var edge = FindConnectedEdge(railway, initial.LastRoute);

            if (edge == null)
            {
                yield break;
            }

            foreach (var route in edge.Module.Routes.Where(route => route.From == edge))
            {
                yield return(new PartialRoute(initial, route));
            }
        }
示例#2
0
 /// <summary>
 /// Is this equal to other?
 /// </summary>
 public bool Equals(PartialRoute other)
 {
     return((other != null) && (routes.Equals(other.routes)));
 }
示例#3
0
 /// <summary>
 /// Clone ctor
 /// </summary>
 public PartialRoute(PartialRoute source, IRoute addition)
 {
     routes.AddRange(source.routes);
     routes.Add(addition);
 }