TiledPipelineExtensions.TileLayer.ReadAsCsv C# (CSharp) Method

ReadAsCsv() private method

private ReadAsCsv ( XmlNode node, XmlNode dataNode ) : void
node System.Xml.XmlNode
dataNode System.Xml.XmlNode
return void
        private void ReadAsCsv(XmlNode node, XmlNode dataNode)
        {
            // split the text up into lines
            string[] lines = node.InnerText.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);

            // iterate each line
            for (int i = 0; i < lines.Length; i++)
            {
                // split the line into individual pieces
                string[] indices = lines[i].Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                // iterate the indices and store in our data
                for (int j = 0; j < indices.Length; j++)
                {
                    Data[i * Width + j] = int.Parse(indices[j], CultureInfo.InvariantCulture);
                }
            }
        }