Example #1
0
        public static Railway.Point GetTail(Railway.Point point)
        {
            if (point == null)
            {
                return(null);
            }

            while (true)
            {
                Railway.Point nextPoint = point.GetNextPoint();
                if (nextPoint == null)
                {
                    return(point);
                }
                else
                {
                    point = nextPoint;
                }
            }
        }
Example #2
0
        public static void Travel(Railway.Point point, System.Action <Railway.Point> action)
        {
            if (point == null)
            {
                return;
            }

            while (true)
            {
                action(point);

                Railway.Point nextPoint = point.GetNextPoint();

                if (nextPoint == null)
                {
                    break;
                }
                else
                {
                    point = nextPoint;
                }
            }
        }