Пример #1
0
        public void Parse(String line)
        {
            char[]   charSeparators = new char[] { ' ' };
            String[] items          = line.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries);
            if (items.Length == Items)
            {
                Angle      = System.Convert.ToInt32(items[1]);
                Position.X = System.Convert.ToInt32(items[2]);
                Position.Y = System.Convert.ToInt32(items[3]);
                Size       = System.Convert.ToInt32(items[4]);
                Hiden      = System.Convert.ToInt32(items[5]);
                Part       = System.Convert.ToInt32(items[6]);
                Dmg        = System.Convert.ToInt32(items[7]);
                Text       = items[8].Remove('"');
                Italic.Parse(items[9]);

                Bold = System.Convert.ToInt32(items[10]);
                HAlign.Parse(items[11]);
                VAlign.Parse(items[12]);
            }
            else
            {
                throw new Exception("LibPolygon public class parse error. Unexpected number of items.");
            }
        }
Пример #2
0
        public void Parse(String[] items)
        {
            if (items.Length == Items)
            {
                Angle      = System.Convert.ToInt32(items[1]);
                Position.X = System.Convert.ToInt32(items[2]);
                Position.Y = System.Convert.ToInt32(items[3]);
                Size       = System.Convert.ToInt32(items[4]);
                Hiden      = System.Convert.ToInt32(items[5]);
                Part       = System.Convert.ToInt32(items[6]);
                Dmg        = System.Convert.ToInt32(items[7]);
                Text       = items[8].Trim('"');
                Italic.Parse(items[9]);

                Bold = System.Convert.ToInt32(items[10]);
                HAlign.Parse(items[11]);
                VAlign.Parse(items[12]);
            }
            else
            {
                throw new Exception("LibPolygon public class parse error. Unexpected number of items.");
            }
        }