Example #1
0
        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();

            builder.Append($"1{Sp}{Red}{Sp}" +
                           $"2{Sp}{Green}{Sp}" +
                           $"3{Sp}{Blue}{Sp}" +
                           $"11{Sp}{Red2}{Sp}" +
                           $"12{Sp}{Green2}{Sp}" +
                           $"13{Sp}{Blue2}{Sp}" +
                           $"6{Sp}{ID}{Sp}" +
                           $"7{Sp}{GameConvert.SingleToString(Opacity)}{Sp}" +
                           $"15{Sp}1{Sp}18{Sp}0{Sp}8{Sp}1");

            if (PlayerColor != -1 && PlayerColor != 0)
            {
                builder.Append($"{Sp}4{Sp}{PlayerColor}");
            }
            if (Blending)
            {
                builder.Append($"{Sp}5{Sp}1");
            }

            if (TargetChannelID != 0)
            {
                builder.Append($"{Sp}9{Sp}{TargetChannelID}{Sp}10{Sp}{(ColorHSV == null ? new Hsv().ToString() : ColorHSV.ToString())}");
                if (CopyOpacity)
                {
                    builder.Append($"{Sp}17{Sp}1");
                }
            }
            return(builder.ToString());
        }
Example #2
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)}");
 }
Example #3
0
 public override string ToString()
 {
     return($"{base.ToString()}" +
            $",51,{TargetGroupID}" +
            $",71,{CenterGroupID}" +
            $",70,{(LockObjectRotation == true? "1": "0")}" +
            $",68,{Degrees}" +
            $",69,{Times360}" +
            $",10,{GameConvert.SingleToString(Time)}" +
            $",30,{(byte)EasingType}" +
            $",85,{GameConvert.SingleToString(EasingTime)}");
 }
 public void SingleToString(string expected, float value)
 {
     Assert.AreEqual(expected, GameConvert.SingleToString(value));
 }