コード例 #1
0
        public List <string> GetClothes(string cityName, DateTime datetime, int duration)
        {
            Station station    = _stationRepository.GetStation(cityName);
            var     parameters = new ClothingParameters(station, datetime, duration);

            return(CalculateClothes(parameters));;
        }
コード例 #2
0
        private List <string> CalculateClothes(ClothingParameters parameters)
        {
            var clothes = new List <string>();

            if (parameters.Temperature < MAXTemperatureForWinterClothes)
            {
                clothes.AddRange(ClothesPackages.WinterClothes);
            }
            else if (parameters.Precipation > MINPrecipationForRainClothes)
            {
                clothes.AddRange(ClothesPackages.RainClothes);
            }
            else if (parameters.Temperature < MAXTemperatureForSpringClothes)
            {
                clothes.AddRange(ClothesPackages.SpringClothes);
            }
            else if (parameters.Temperature > MINTemperatureForSummerShoes)
            {
                clothes.AddRange(ClothesPackages.SummerShoes);
            }
            else
            {
                clothes.AddRange(ClothesPackages.BaseShoes);
            }

            if (parameters.Temperature < MAXTemperatureForSpringClothes)
            {
                clothes.AddRange(ClothesPackages.BaseClothes);
            }
            else
            {
                clothes.AddRange(ClothesPackages.SummerClothes);
            }

            return(clothes);
        }