public Stage MapGlitchObjectToStage(@object obj)
        {
            var left = Convert.ToInt32([email protected](x => x.id == "l").Value);
            var right = Convert.ToInt32([email protected](x => x.id == "r").Value);
            var top = Convert.ToInt32([email protected](x => x.id == "t").Value);
            var bottom = Convert.ToInt32([email protected](x => x.id == "b").Value);
            var stage = new Stage
            {
                Width = right - left,
                Height = bottom - top,
                Id = obj.str.Single(x => x.id == "tsid").Value,
                Label = obj.str.Single(x => x.id == "label").Value,
            };

            var gradient = obj.object1.SingleOrDefault(x => x.id == "gradient");
            if (gradient != null)
            {
                var bottomGradient = System.Drawing.ColorTranslator.FromHtml("#" + gradient.str.Single(x => x.id == "bottom").Value);
                stage.BottomGradientColor = Color.FromArgb(bottomGradient.A, bottomGradient.R, bottomGradient.G, bottomGradient.B);
                var topGradient = System.Drawing.ColorTranslator.FromHtml("#" + gradient.str.Single(x => x.id == "top").Value);
                stage.TopGradientColor = Color.FromArgb(topGradient.A, topGradient.R, topGradient.G, topGradient.B);
            }

            return stage;
        }
 public void SaveFurryRunFile(string fileName, Stage stage)
 {
     using (var stream = new FileStream(fileName, FileMode.Create, FileAccess.Write))
     {
         var xmlSerializer = new XmlSerializer(typeof(Stage));
         xmlSerializer.Serialize(stream, stage);
     }
 }