Example #1
0
        protected override void finish()
        {
            if (!(keyGenerator.have_value))
            {
                throw new Exception("The `TemplateName' field is missing.");
            }
            TemplateJSON result = createForKey(keyGenerator.value, unknownFieldGenerator.index);

            Debug.Assert(result != null);
            finish(result);
            int extra_count = unknownFieldGenerator.field_names.Count;

            Debug.Assert(extra_count == unknownFieldGenerator.field_values.Count);
            for (int extra_num = 0; extra_num < extra_count; ++extra_num)
            {
                result.extraTemplateAppendPair(unknownFieldGenerator.field_names[extra_num], unknownFieldGenerator.field_values[extra_num]);
            }
            unknownFieldGenerator.field_names.Clear();
            unknownFieldGenerator.field_values.Clear();
            unknownFieldGenerator.index = new Dictionary <string, JSONValue>();
            if (!allow_incomplete)
            {
                string missing_field_error = result.missing_field_error(allow_unpolished);
                if (missing_field_error != null)
                {
                    error(missing_field_error);
                }
            }
            handle_result(result);
        }
Example #2
0
        private void  fromJSONTemplateData(JSONValue json_value, bool ignore_extras)
        {
            Debug.Assert(json_value != null);
            TemplateJSON convert_classy = TemplateJSON.from_json(json_value, ignore_extras, true);

            setTemplateData(convert_classy);
        }
Example #3
0
        public void Generate(string name, Bitmap texture_X, Bitmap texture_Y, Bitmap texture_Z)
        {
            if (World == null)
            {
                return;
            }
            EditorImage editor = new EditorImage();

            editor.Texture_Z = texture_Z;
            editor.Texture_Y = texture_Y;
            editor.Texture_X = texture_X;

            string p = Info.address_Images_HDD + @"/Templates/";

            if (!Directory.Exists(p))
            {
                Directory.CreateDirectory(p);
            }

            p += name;

            editor.OnImageCube(p + ".png");

            string URL = Info.ImageToUrl(p);

            TemplateJSON template = new TemplateJSON(name, 4, 4, URL);

            World.Add(template);
            //Save();
        }
Example #4
0
 public void setTemplateData(TemplateJSON new_value)
 {
     if (flagHasTemplateData)
     {
     }
     flagHasTemplateData = true;
     storeTemplateData   = new_value;
 }
Example #5
0
 public Appearances_Information()
 {
     Name      = "Information";
     Form      = new Appearance_Information();
     Control   = new Appearance_Information();
     TextBox   = new Appearance_Information();
     Templates = new TemplateJSON[]
     {
         new TemplateJSON("Metal", 1, 1, "http://www.ressources-webdesign.com/wp-content/uploads/2010/08/metal-texture-500.png"),
         new TemplateJSON("MetalPlate", 1, 1, "http://www.psdgraphics.com/wp-content/uploads/2009/01/metal-plate.jpg"),
         new TemplateJSON("SteelMesh", 1, 1, "http://www.psdgraphics.com/wp-content/uploads/2010/07/steel-mesh.jpg"),
         new TemplateJSON("Gold", 1, 1, "http://www.psdgraphics.com/wp-content/uploads/2009/07/gold-texture.jpg"),
         new TemplateJSON("Vintage", 1, 1, "https://image.freepik.com/photos-libre/grunge-vieille-texture-vintage_19-113524.jpg"),
         new TemplateJSON("DarkMetal", 1, 1, "http://www.psdgraphics.com/wp-content/uploads/2009/01/dark-metal-texture.jpg")
     };
 }
Example #6
0
        public void Template(TemplateJSON template)
        {
            if (template == null || World == null)
            {
                return;
            }
            int index = -1;

            for (var i = 0; i < World.Templates.Length; i++)
            {
                if (World.Templates[i].Name == template.Name)
                {
                    index = i;
                }
            }
            if (index > -1)
            {
                World.Templates[index] = template;
            }
            else
            {
                World.Add(template);
            }
        }
Example #7
0
 protected override void handle_result(TemplateJSON new_result)
 {
     handle_result((VerticalTemplateListTemplateJSON )new_result);
 }
Example #8
0
 protected override void handle_result(TemplateJSON result)
 {
     top.value.Add(result);
 }
Example #9
0
        protected override void handle_result(TemplateJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
Example #10
0
 protected abstract void handle_result(TemplateJSON new_result);
Example #11
0
 protected void finish(TemplateJSON result)
 {
 }
 protected override void handle_result(TemplateJSON new_result)
 {
     handle_result((DescriptiveTextTemplateJSON )new_result);
 }
Example #13
0
 protected override void handle_result(TemplateJSON new_result)
 {
     handle_result((SimpleTextTemplateJSON )new_result);
 }