예제 #1
0
        // 新增\数量改变,不包括删除
        public void psstNotifyOneCardTujianInfoCmd(uint id, byte num)
        {
            TableItemBase tableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, id);

            if (tableItem != null)
            {
                if (!m_id2CardDic.ContainsKey(id))
                {
                    CardItemBase item = new CardItemBase();
                    item.m_tujian        = new t_Tujian();
                    item.m_tujian.id     = id;
                    item.m_tujian.num    = num;
                    item.m_tableItemCard = tableItem.m_itemBody as TableCardItemBody;

                    m_cardListArr[item.m_tableItemCard.m_career].Add(item);
                    m_id2CardDic[id] = item;
                }
                m_id2CardDic[id].m_tujian.num = num;
            }
            else
            {
                Ctx.m_instance.m_logSys.error("psstNotifyOneCardTujianInfoCmd 不能查找到卡牌 Item");
            }

            // 更新卡牌图鉴中的显示
            IUITuJian uiTuJian = Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUITuJian) as IUITuJian;

            if (uiTuJian != null)
            {
                uiTuJian.updateMidCardModel();
            }
        }
예제 #2
0
        public void psstNotifyAllCardTujianInfoCmd(List <t_Tujian> list)
        {
            clearAllTuJian();

            CardItemBase  item      = null;
            int           idx       = 0;
            TableItemBase tableItem = null;

            while (idx < list.Count)
            {
                tableItem = Ctx.m_instance.m_tableSys.getItem(TableID.TABLE_CARD, list[idx].id);
                if (tableItem != null)
                {
                    item                 = new CardItemBase();
                    item.m_tujian        = list[idx];
                    item.m_tableItemCard = tableItem.m_itemBody as TableCardItemBody;

                    m_cardListArr[item.m_tableItemCard.m_career].Add(item);
                    m_id2CardDic[list[idx].id] = item;
                }
                else
                {
                    Ctx.m_instance.m_logSys.log("表格读取失败");
                }

                ++idx;
            }

            // 更新卡牌图鉴中的显示
            IUITuJian uiTuJian = Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUITuJian) as IUITuJian;

            if (uiTuJian != null)
            {
                uiTuJian.updateMidCardModel();
            }
        }