private ProfSkillTable.RowData BinarySearchProfID(int key, int min, int max)
        {
            ProfSkillTable.RowData rowData = this.Table[min];
            if (rowData.ProfID == key)
            {
                return(rowData);
            }
            ProfSkillTable.RowData rowData2 = this.Table[max];
            if (rowData2.ProfID == key)
            {
                return(rowData2);
            }
            if (max - min <= 1)
            {
                return(null);
            }
            int num = min + (max - min) / 2;

            ProfSkillTable.RowData rowData3 = this.Table[num];
            if (rowData3.ProfID.CompareTo(key) > 0)
            {
                return(this.BinarySearchProfID(key, min, num));
            }
            if (rowData3.ProfID.CompareTo(key) < 0)
            {
                return(this.BinarySearchProfID(key, num, max));
            }
            return(rowData3);
        }
 protected override void ReadLine(BinaryReader reader)
 {
     ProfSkillTable.RowData rowData = new ProfSkillTable.RowData();
     base.Read <int>(reader, ref rowData.ProfID, CVSReader.intParse);
     this.columnno = 0;
     base.Read <string>(reader, ref rowData.ProfName, CVSReader.stringParse);
     this.columnno = 1;
     base.Read <string>(reader, ref rowData.Skill1, CVSReader.stringParse);
     this.columnno = 2;
     base.Read <string>(reader, ref rowData.Skill2, CVSReader.stringParse);
     this.columnno = 3;
     base.Read <string>(reader, ref rowData.Skill3, CVSReader.stringParse);
     this.columnno = 4;
     base.Read <string>(reader, ref rowData.Skill4, CVSReader.stringParse);
     this.columnno = 5;
     base.Read <string>(reader, ref rowData.ProfIcon, CVSReader.stringParse);
     this.columnno = 6;
     base.Read <string>(reader, ref rowData.ProfPic, CVSReader.stringParse);
     this.columnno = 7;
     base.Read <string>(reader, ref rowData.ProfHeadIcon, CVSReader.stringParse);
     this.columnno = 8;
     base.Read <string>(reader, ref rowData.ProfHeadIcon2, CVSReader.stringParse);
     this.columnno = 9;
     base.Read <float>(reader, ref rowData.FixedEnmity, CVSReader.floatParse);
     this.columnno = 10;
     base.Read <float>(reader, ref rowData.EnmityCoefficient, CVSReader.floatParse);
     this.columnno = 11;
     base.Read <string>(reader, ref rowData.Description, CVSReader.stringParse);
     this.columnno = 12;
     base.Read <uint>(reader, ref rowData.PromoteExperienceID, CVSReader.uintParse);
     this.columnno = 13;
     base.Read <uint>(reader, ref rowData.OperateLevel, CVSReader.uintParse);
     this.columnno = 14;
     base.Read(reader, ref rowData.PromoteLR);
     this.columnno = 15;
     base.Read <string>(reader, ref rowData.ProfNameIcon, CVSReader.stringParse);
     this.columnno = 16;
     base.Read <string>(reader, ref rowData.ProfIntro, CVSReader.stringParse);
     this.columnno = 17;
     base.Read <string>(reader, ref rowData.ProfTypeIntro, CVSReader.stringParse);
     this.columnno = 18;
     base.Read <string>(reader, ref rowData.ProfWord1, CVSReader.stringParse);
     this.columnno = 19;
     base.Read <string>(reader, ref rowData.ProfWord2, CVSReader.stringParse);
     this.columnno = 20;
     this.AddRowProfID(rowData.ProfID, rowData, 0, this.Table.Count - 1);
     this.columnno = -1;
 }
        private void AddRowProfID(int key, ProfSkillTable.RowData row, int min, int max)
        {
            if (this.Table.Count == 0)
            {
                this.Table.Add(row);
                return;
            }
            ProfSkillTable.RowData rowData = this.Table[min];
            if (rowData.ProfID.CompareTo(key) > 0)
            {
                this.Table.Insert(min, row);
                return;
            }
            if (rowData.ProfID == key)
            {
                XSingleton <XDebug> .singleton.AddErrorLog2("Table: ProfSkillTable duplicate id:{0}  lineno: {1}", new object[]
                {
                    key,
                    this.lineno
                });

                return;
            }
            ProfSkillTable.RowData rowData2 = this.Table[max];
            if (rowData2.ProfID.CompareTo(key) < 0)
            {
                this.Table.Insert(max + 1, row);
                return;
            }
            if (rowData2.ProfID == key)
            {
                XSingleton <XDebug> .singleton.AddErrorLog2("Table: ProfSkillTable duplicate id:{0}  lineno: {1}", new object[]
                {
                    key,
                    this.lineno
                });

                return;
            }
            if (max - min <= 1)
            {
                this.Table.Insert(min + 1, row);
                return;
            }
            int num = min + (max - min) / 2;

            ProfSkillTable.RowData rowData3 = this.Table[num];
            if (rowData3.ProfID.CompareTo(key) > 0)
            {
                this.AddRowProfID(key, row, min, num);
                return;
            }
            if (rowData3.ProfID.CompareTo(key) < 0)
            {
                this.AddRowProfID(key, row, num, max);
                return;
            }
            XSingleton <XDebug> .singleton.AddErrorLog2("Table: ProfSkillTable duplicate id:{0}  lineno: {1}", new object[]
            {
                key,
                this.lineno
            });
        }
 protected override bool OnLine(string[] Fields)
 {
     ProfSkillTable.RowData rowData = new ProfSkillTable.RowData();
     if (!base.Parse(Fields[this.ColMap[0]], ref rowData.ProfID))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[1]], ref rowData.ProfName))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[2]], ref rowData.Skill1))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[3]], ref rowData.Skill2))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[4]], ref rowData.Skill3))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[5]], ref rowData.Skill4))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[6]], ref rowData.ProfIcon))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[7]], ref rowData.ProfPic))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[8]], ref rowData.ProfHeadIcon))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[9]], ref rowData.ProfHeadIcon2))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[10]], ref rowData.FixedEnmity))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[11]], ref rowData.EnmityCoefficient))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[12]], ref rowData.Description))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[13]], ref rowData.PromoteExperienceID))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[14]], ref rowData.OperateLevel))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[15]], ref rowData.PromoteLR))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[16]], ref rowData.ProfNameIcon))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[17]], ref rowData.ProfIntro))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[18]], ref rowData.ProfTypeIntro))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[19]], ref rowData.ProfWord1))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[20]], ref rowData.ProfWord2))
     {
         return(false);
     }
     this.AddRowProfID(rowData.ProfID, rowData, 0, this.Table.Count - 1);
     return(true);
 }