コード例 #1
0
        public static void Load(VertexStorage vertexSource, string pathAndFileName)
        {
            vertexSource.remove_all();
            string[] allLines = File.ReadAllLines(pathAndFileName);
            foreach (string line in allLines)
            {
                string[] elements = line.Split(',');
                double   x        = double.Parse(elements[0]);
                double   y        = double.Parse(elements[1]);
                ShapePath.FlagsAndCommand flagsAndCommand = (ShapePath.FlagsAndCommand)System.Enum.Parse(typeof(ShapePath.FlagsAndCommand), elements[2].Trim());
                for (int i = 3; i < elements.Length; i++)
                {
                    flagsAndCommand |= (ShapePath.FlagsAndCommand)System.Enum.Parse(typeof(ShapePath.FlagsAndCommand), elements[i].Trim());
                }

                vertexSource.Add(x, y, flagsAndCommand);
            }
        }
コード例 #2
0
 public void remove_all()
 {
     vertices.remove_all(); iteratorIndex = 0;
 }