AddRoute() private method

private AddRoute ( RouteJson route ) : void
route RouteJson
return void
Beispiel #1
0
        /// <summary>
        /// Create a world object from a Netlink object.
        /// </summary>
        /// <param name="n">The Netlink class that represents the Netlink JSON.</param>
        /// <returns>A world generated from the Netlink.</returns>
        public static World GenerateWorld(Netlink n)
        {
            World w = new World();

            foreach (RouteJson r in n.routes)
            {
                w.AddRoute(r);
            }

            foreach (StopJson s in n.stops)
            {
                w.AddStop(s);
            }

            return(w);
        }
        /// <summary>
        /// Create a world object from a Netlink object.
        /// </summary>
        /// <param name="n">The Netlink class that represents the Netlink JSON.</param>
        /// <returns>A world generated from the Netlink.</returns>
        public static World GenerateWorld(Netlink n)
        {
            World w = new World();

            foreach (RouteJson r in n.routes)
            {
                w.AddRoute(r);
            }

            foreach (StopJson s in n.stops)
            {
                w.AddStop(s);
            }

            return w;
        }