Exemple #1
0
        public static RouteResponse BuildFromModel(OdcinekWłasny route)
        {
            var response = new RouteResponse()
            {
                Id            = route.Id,
                Points        = route.Punkty,
                Start         = PlaceResponse.BuildFromModel(route.Poczatek),
                End           = PlaceResponse.BuildFromModel(route.Koniec),
                MountainGroup = route.GrupaGorska.Nazwa
            };

            return(response);
        }
Exemple #2
0
        public static PlaceResponse BuildFromModel(Miejsce place)
        {
            var response = new PlaceResponse()
            {
                Id        = place.Id,
                Name      = place.Nazwa,
                Longitude = place.DlugoscGeograficzna,
                Latitude  = place.SzerokoscGeograficzna,
                Altitude  = place.WysokoscNpm
            };

            return(response);
        }
Exemple #3
0
        public static RouteResponse CreateCustomRoute(PlaceResponse start, PlaceResponse end, string mountainGroup, double distance)
        {
            var response = new RouteResponse()
            {
                Id            = -1,
                Points        = 0,
                Start         = start,
                End           = end,
                MountainGroup = mountainGroup
            };

            response.CalculatePoints(distance);
            return(response);
        }