Esempio n. 1
0
        // 所有 hero 的数据
        public void psstRetAllHeroInfoUserCmd(List<t_hero> infoList)
        {
            m_heroList.Clear();
            m_id2HeroDic.Clear();

            HeroItem clientItem;
            foreach (t_hero item in infoList)
            {
                clientItem = new HeroItem();
                clientItem.m_svrHero = item;
                m_heroList.Add(clientItem);
                m_id2HeroDic[clientItem.m_svrHero.occupation] = clientItem;
            }
        }
Esempio n. 2
0
        // 所有 hero 的数据
        public void psstRetAllHeroInfoUserCmd(List <t_hero> infoList)
        {
            m_heroList.Clear();
            m_id2HeroDic.Clear();

            HeroItem clientItem;

            foreach (t_hero item in infoList)
            {
                clientItem           = new HeroItem();
                clientItem.m_svrHero = item;
                m_heroList.Add(clientItem);
                m_id2HeroDic[clientItem.m_svrHero.occupation] = clientItem;
            }
        }
Esempio n. 3
0
 public void psstRetOneHeroInfoUserCmd(t_hero info)
 {
     HeroItem clientItem;
     if (!m_id2HeroDic.ContainsKey(info.occupation))
     {
         clientItem = new HeroItem();
         clientItem.m_svrHero = info;
         m_heroList.Add(clientItem);
         m_id2HeroDic[clientItem.m_svrHero.occupation] = clientItem;
     }
     else
     {
         // 直接拷贝
         m_id2HeroDic[info.occupation].m_svrHero.copyFrom(info);
     }
 }
Esempio n. 4
0
        public void psstRetOneHeroInfoUserCmd(t_hero info)
        {
            HeroItem clientItem;

            if (!m_id2HeroDic.ContainsKey(info.occupation))
            {
                clientItem           = new HeroItem();
                clientItem.m_svrHero = info;
                m_heroList.Add(clientItem);
                m_id2HeroDic[clientItem.m_svrHero.occupation] = clientItem;
            }
            else
            {
                // 直接拷贝
                m_id2HeroDic[info.occupation].m_svrHero.copyFrom(info);
            }
        }