示例#1
0
        private static ArrayList GetTemplateList()
        {
            ArrayList alMagicTable = new ArrayList();
            Regex     re           = new Regex(@"\s*(\w+)h\W*(\w+)\W*(\w+)\W*(\w+)\W*(\d+)x(\d+)]\W*(\w+)\s*\W*(.*)");

            foreach (string strToMatch in s_astrMagicTable)
            {
                Match      mat = re.Match(strToMatch);
                MagicEntry me  = new MagicEntry();
                me.index     = Int32.Parse(mat.Groups[1].Value, NumberStyles.HexNumber);
                me.aiTheater = new byte[3];
                string strT = mat.Groups[2].Value;
                me.aiTheater[0] = strT == "x" ? (byte)0xff : byte.Parse(strT);
                strT            = mat.Groups[3].Value;
                me.aiTheater[1] = strT == "x" ? (byte)0xff : byte.Parse(strT);
                strT            = mat.Groups[4].Value;
                me.aiTheater[2] = strT == "x" ? (byte)0xff : byte.Parse(strT);
                me.ctx          = short.Parse(mat.Groups[5].Value);
                me.cty          = short.Parse(mat.Groups[6].Value);
                me.strName      = mat.Groups[7].Value;
                me.strComment   = mat.Groups[8].Value;
                alMagicTable.Add(me);
            }
            return(alMagicTable);
        }
示例#2
0
 private static ArrayList GetTemplateList()
 {
     ArrayList alMagicTable = new ArrayList();
     Regex re = new Regex(@"\s*(\w+)h\W*(\w+)\W*(\w+)\W*(\w+)\W*(\d+)x(\d+)]\W*(\w+)\s*\W*(.*)");
     foreach (string strToMatch in s_astrMagicTable) {
         Match mat = re.Match(strToMatch);
         MagicEntry me = new MagicEntry();
         me.index = Int32.Parse(mat.Groups[1].Value, NumberStyles.HexNumber);
         me.aiTheater = new byte[3];
         string strT = mat.Groups[2].Value;
         me.aiTheater[0] = strT == "x" ? (byte)0xff : byte.Parse(strT);
         strT = mat.Groups[3].Value;
         me.aiTheater[1] = strT == "x" ? (byte)0xff : byte.Parse(strT);
         strT = mat.Groups[4].Value;
         me.aiTheater[2] = strT == "x" ? (byte)0xff : byte.Parse(strT);
         me.ctx = short.Parse(mat.Groups[5].Value);
         me.cty = short.Parse(mat.Groups[6].Value);
         me.strName = mat.Groups[7].Value;
         me.strComment = mat.Groups[8].Value;
         alMagicTable.Add(me);
     }
     return alMagicTable;
 }