Exemplo n.º 1
0
        public async Task <DancerResponse> Dancing(float latitude, float longitude)
        {
            var weather = await GetWeather(latitude, longitude);


            var random      = new Random();
            var randomBirds = random.Next(100) < 10;

            var dancer = new DancerResponse()
            {
                Lat      = latitude,
                Lng      = longitude,
                HasBirds = randomBirds,
                Weather  = new WeatherResponse()
                {
                    WindDirection = WindDirection.WindDegreesToDirection(weather.Wind.Deg),
                    WindDegree    = weather.Wind.Deg,
                    WindSpeed     = weather.Wind.Speed
                },
                HasDangerDanger = IsDangerDanger(weather),
                HasNoFlyZone    = await _noFlyingBusiness.IsInNoFlyZone(latitude, longitude),
                MaxHeight       = 1000,
            };

            return(dancer);
        }
Exemplo n.º 2
0
        public async Task <WeatherResponse> GetParsed(float latitude, float longitude)
        {
            var weather = await GetWeather(latitude, longitude);

            return(new WeatherResponse()
            {
                WindDirection = WindDirection.WindDegreesToDirection(weather.Wind.Deg),
                WindDegree = weather.Wind.Deg,
                WindSpeed = weather.Wind.Speed
            });
        }