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

            return(index >= 0 ? sorted[index] : default(StoreDataBase));
        }
Exemplo n.º 2
0
    protected override void OnJump(UIPanelBase.PanelJumpData jumpData)
    {
        base.OnJump(jumpData);
        if (jumpData == null)
        {
            jumpData = new PanelJumpData();
        }
        int firstTabData  = -1;
        int secondTabData = -1;

        UIPanelBase.PanelJumpData data = (UIPanelBase.PanelJumpData)jumpData;
        if (data.Tabs != null)
        {
            if (data.Tabs.Length > 0)
            {
                UIFrameManager.Instance.OnCilckTogglePanel(this.PanelId, 1, data.Tabs[0]);
            }
            if (data.Tabs.Length > 1)
            {
                SetActiveTab(data.Tabs[1], true);
            }
        }
        if (data.Param is uint)
        {
            uint          storeItemID = (uint)data.Param;
            StoreDataBase table       = GameTableManager.Instance.GetTableItem <StoreDataBase>(storeItemID);
            if (table != null)
            {
                SetActiveStore((GameCmd.CommonStore)(int) table.storeId);
                SetActiveTab((int)table.tag);
                SetSelectItemId(storeItemID, true, true);
            }
            else
            {
                Engine.Utility.Log.Error("ID为{0}的商品为null", storeItemID);
            }
        }
    }