Exemple #1
0
        private LevelSealTypeTable.RowData BinarySearchType(uint key, int min, int max)
        {
            LevelSealTypeTable.RowData rowData = this.Table[min];
            if (rowData.Type == key)
            {
                return(rowData);
            }
            LevelSealTypeTable.RowData rowData2 = this.Table[max];
            if (rowData2.Type == key)
            {
                return(rowData2);
            }
            if (max - min <= 1)
            {
                return(null);
            }
            int num = min + (max - min) / 2;

            LevelSealTypeTable.RowData rowData3 = this.Table[num];
            if (rowData3.Type.CompareTo(key) > 0)
            {
                return(this.BinarySearchType(key, min, num));
            }
            if (rowData3.Type.CompareTo(key) < 0)
            {
                return(this.BinarySearchType(key, num, max));
            }
            return(rowData3);
        }
Exemple #2
0
 protected override void ReadLine(BinaryReader reader)
 {
     LevelSealTypeTable.RowData rowData = new LevelSealTypeTable.RowData();
     base.Read <uint>(reader, ref rowData.Type, CVSReader.uintParse);
     this.columnno = 0;
     base.Read <uint>(reader, ref rowData.Level, CVSReader.uintParse);
     this.columnno = 1;
     base.Read <uint>(reader, ref rowData.Time, CVSReader.uintParse);
     this.columnno = 2;
     base.ReadArray <uint>(reader, ref rowData.UnlockBossID, CVSReader.uintParse);
     this.columnno = 3;
     base.Read <string>(reader, ref rowData.UnlockBossName, CVSReader.stringParse);
     this.columnno = 4;
     base.Read <uint>(reader, ref rowData.UnlockBossCount, CVSReader.uintParse);
     this.columnno = 5;
     base.Read <string>(reader, ref rowData.NowSealImage, CVSReader.stringParse);
     this.columnno = 6;
     base.Read <string>(reader, ref rowData.NextSealImageL, CVSReader.stringParse);
     this.columnno = 7;
     base.Read <string>(reader, ref rowData.NextSealImageR, CVSReader.stringParse);
     this.columnno = 8;
     base.Read <string>(reader, ref rowData.NextSealImageBig, CVSReader.stringParse);
     this.columnno = 9;
     base.Read <string>(reader, ref rowData.MailTitle, CVSReader.stringParse);
     this.columnno = 10;
     base.Read <string>(reader, ref rowData.MailContent, CVSReader.stringParse);
     this.columnno = 11;
     base.ReadSeqList <uint>(reader, ref rowData.Award, CVSReader.uintParse);
     this.columnno = 12;
     base.ReadSeq <uint>(reader, ref rowData.ExchangeInfo, CVSReader.uintParse);
     this.columnno = 13;
     base.ReadSeqList <uint>(reader, ref rowData.CollectAward, CVSReader.uintParse);
     this.columnno = 14;
     base.ReadSeqList <string>(reader, ref rowData.CollectAwardMailText, CVSReader.stringParse);
     this.columnno = 15;
     base.ReadSeqList <uint>(reader, ref rowData.PlayerAward, CVSReader.uintParse);
     this.columnno = 16;
     base.ReadSeq <string>(reader, ref rowData.PlayerAwardText, CVSReader.stringParse);
     this.columnno = 17;
     base.Read <uint>(reader, ref rowData.ClearFindBackMinLevel, CVSReader.uintParse);
     this.columnno = 18;
     base.Read <int>(reader, ref rowData.ApplyStudentLevel, CVSReader.intParse);
     this.columnno = 19;
     base.Read <int>(reader, ref rowData.ApplyMasterPromptLevel, CVSReader.intParse);
     this.columnno = 20;
     this.AddRowType(rowData.Type, rowData, 0, this.Table.Count - 1);
     this.columnno = -1;
 }
Exemple #3
0
        private void AddRowType(uint key, LevelSealTypeTable.RowData row, int min, int max)
        {
            if (this.Table.Count == 0)
            {
                this.Table.Add(row);
                return;
            }
            LevelSealTypeTable.RowData rowData = this.Table[min];
            if (rowData.Type.CompareTo(key) > 0)
            {
                this.Table.Insert(min, row);
                return;
            }
            if (rowData.Type == key)
            {
                XSingleton <XDebug> .singleton.AddErrorLog2("Table: LevelSealTypeTable duplicate id:{0}  lineno: {1}", new object[]
                {
                    key,
                    this.lineno
                });

                return;
            }
            LevelSealTypeTable.RowData rowData2 = this.Table[max];
            if (rowData2.Type.CompareTo(key) < 0)
            {
                this.Table.Insert(max + 1, row);
                return;
            }
            if (rowData2.Type == key)
            {
                XSingleton <XDebug> .singleton.AddErrorLog2("Table: LevelSealTypeTable 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;

            LevelSealTypeTable.RowData rowData3 = this.Table[num];
            if (rowData3.Type.CompareTo(key) > 0)
            {
                this.AddRowType(key, row, min, num);
                return;
            }
            if (rowData3.Type.CompareTo(key) < 0)
            {
                this.AddRowType(key, row, num, max);
                return;
            }
            XSingleton <XDebug> .singleton.AddErrorLog2("Table: LevelSealTypeTable duplicate id:{0}  lineno: {1}", new object[]
            {
                key,
                this.lineno
            });
        }
Exemple #4
0
 protected override bool OnLine(string[] Fields)
 {
     LevelSealTypeTable.RowData rowData = new LevelSealTypeTable.RowData();
     if (!base.Parse(Fields[this.ColMap[0]], ref rowData.Type))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[1]], ref rowData.Level))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[2]], ref rowData.Time))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[3]], ref rowData.UnlockBossID))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[4]], ref rowData.UnlockBossName))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[5]], ref rowData.UnlockBossCount))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[6]], ref rowData.NowSealImage))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[7]], ref rowData.NextSealImageL))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[8]], ref rowData.NextSealImageR))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[9]], ref rowData.NextSealImageBig))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[10]], ref rowData.MailTitle))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[11]], ref rowData.MailContent))
     {
         return(false);
     }
     if (!base.Parse <uint>(Fields[this.ColMap[12]], ref rowData.Award, CVSReader.uintParse, "2U"))
     {
         return(false);
     }
     if (!base.Parse <uint>(Fields[this.ColMap[13]], ref rowData.ExchangeInfo, CVSReader.uintParse, "2U"))
     {
         return(false);
     }
     if (!base.Parse <uint>(Fields[this.ColMap[14]], ref rowData.CollectAward, CVSReader.uintParse, "2U"))
     {
         return(false);
     }
     if (!base.Parse <string>(Fields[this.ColMap[15]], ref rowData.CollectAwardMailText, CVSReader.stringParse, "2S"))
     {
         return(false);
     }
     if (!base.Parse <uint>(Fields[this.ColMap[16]], ref rowData.PlayerAward, CVSReader.uintParse, "2U"))
     {
         return(false);
     }
     if (!base.Parse <string>(Fields[this.ColMap[17]], ref rowData.PlayerAwardText, CVSReader.stringParse, "2S"))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[18]], ref rowData.ClearFindBackMinLevel))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[19]], ref rowData.ApplyStudentLevel))
     {
         return(false);
     }
     if (!base.Parse(Fields[this.ColMap[20]], ref rowData.ApplyMasterPromptLevel))
     {
         return(false);
     }
     this.AddRowType(rowData.Type, rowData, 0, this.Table.Count - 1);
     return(true);
 }