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; } } }
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; } } }