Ejemplo n.º 1
0
        /// <summary>
        /// 通过[ID]二分快速查表
        /// </summary>
        /// <param name="ID">ID</param>
        /// <returns></returns>
        public static OpenServerDataBase Query(this List <OpenServerDataBase> sorted, uint ID)
        {
            var key = new OpenServerDataBase()
            {
                ID = ID
            };
            var comparer = new Comparer1();
            var index    = sorted.BinarySearch(key, comparer);

            return(index >= 0 ? sorted[index] : default(OpenServerDataBase));
        }
Ejemplo n.º 2
0
 public override void SetGridData(object data)
 {
     base.SetGridData(data);
     if (data != null && data is uint)
     {
         CurrentDay = (uint)data;
         OpenServerDataBase tableData = GameTableManager.Instance.GetTableItem <OpenServerDataBase>(CurrentDay);
         if (tableData != null)
         {
             m_lab_title.text    = tableData.name;
             m_lab_content1.text = tableData.desc1;
             m_lab_content2.text = tableData.desc2;
             list.Clear();
             list.Add(new UIItemRewardData()
             {
                 itemID = tableData.reward_id,
                 num    = 0,
             });
             m_ctor.CreateGrids(list.Count);
             SetSeclect(false);
         }
     }
 }