AbstractedSheep.ShuttleTrackerWorld.World.AddStop C# (CSharp) Метод

AddStop() приватный Метод

private AddStop ( StopJson stop ) : void
stop StopJson
Результат void
        private void AddStop(StopJson stop)
        {
            List<int> routes = new List<int>();
            foreach (StopRouteJson sj in stop.routes)
            {
                routes.Add(sj.id);
            }
            AddStop(stop.short_name, new Coordinate((int)(stop.latitude * (decimal)1E6), (int)(stop.longitude * (decimal)1E6)), stop.name, routes);
        }

Same methods

World::AddStop ( string stopId, Coordinate location, string name, List routes ) : void

Usage Example

Пример #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);
        }
All Usage Examples Of AbstractedSheep.ShuttleTrackerWorld.World::AddStop