Пример #1
0
 public static string Parse(Hsv hsv)
 {
     return
         ($"{hsv.Hue}{SEPARATOR}" +
          $"{GameConvert.SingleToString(hsv.Saturation)}{SEPARATOR}" +
          $"{GameConvert.SingleToString(hsv.Brightness)}{SEPARATOR}" +
          $"{GameConvert.BoolToString(hsv.DeltaSaturation)}{SEPARATOR}" +
          $"{GameConvert.BoolToString(hsv.DeltaBrightness)}");
 }
Пример #2
0
        public void BuildQuery(Parameters parameters)
        {
            string difficultsString = "";

            if (Difficults.Count > 0)
            {
                foreach (Difficult diff in Difficults)
                {
                    difficultsString += ((int)diff).ToString();
                }
            }
            else
            {
                difficultsString = "-";
            }

            string lengthsString = "";

            if (Lengths.Count > 0)
            {
                foreach (LengthType len in Lengths)
                {
                    lengthsString += ((int)len).ToString();
                }
            }
            else
            {
                lengthsString = "-";
            }

            parameters.Add(new Property("str", QueryString));
            parameters.Add(new Property("diff", difficultsString));
            parameters.Add(new Property("len", lengthsString));
            parameters.Add(new Property("page", Page));
            parameters.Add(new Property("type", (int)SearchType));
            parameters.Add(new Property("uncomplited", GameConvert.BoolToString(Uncomplited)));
            parameters.Add(new Property("onlyComplited", GameConvert.BoolToString(Complited)));
            parameters.Add(new Property("total", Total));
            parameters.Add(new Property("original", GameConvert.BoolToString(Original)));
            parameters.Add(new Property("twoPlayer", GameConvert.BoolToString(TwoPlayer)));
            parameters.Add(new Property("coins", GameConvert.BoolToString(HasCoins)));
            parameters.Add(new Property("epic", GameConvert.BoolToString(Epic)));

            foreach (Difficult diff in Difficults)
            {
                if (diff == Difficult.Demon)
                {
                    parameters.Add(new Property("demonFilter", (int)DemonDifficult));
                }
            }
            if (Feautured >= 0)
            {
                parameters.Add(new Property("featured", Feautured));
            }
        }
Пример #3
0
 public void BoolToString(string expected, bool value, bool isReverse)
 {
     Assert.AreEqual(expected, GameConvert.BoolToString(value, isReverse));
 }