AoMEngineLibrary.Graphics.Grn.Nodes.GrnRenderPassTrianglesNode.CreateFolderFile C# (CSharp) Method

CreateFolderFile() public method

public CreateFolderFile ( string folder ) : void
folder string
return void
        public override void CreateFolderFile(string folder)
        {
            XDocument doc = new XDocument();
            XElement root = new XElement("rpTriangles", new XAttribute("count", this.Count));
            doc.Add(root);

            foreach (KeyValuePair<int, List<int>> texInd in this.TextureIndices)
            {
                XElement face = new XElement("face", new XAttribute("index", texInd.Key));
                root.Add(face);
                face.Add(new XElement("textureCoordinateIndex", texInd.Value[0]));
                face.Add(new XElement("textureCoordinateIndex", texInd.Value[1]));
                face.Add(new XElement("textureCoordinateIndex", texInd.Value[2]));
            }

            string fileName = System.IO.Path.Combine(folder, "rpTriangles.xml");
            using (FileStream stream = System.IO.File.Create(fileName))
            {
                doc.Save(stream);
            }
        }