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); } }
public override void derialize(ByteBuffer bu) { base.derialize(bu); bu.readUnsignedInt16(ref count); if(count > 0) { int idx = 0; info = new List<t_hero>(); t_hero item; while(idx < count) { item = new t_hero(); info.Add(item); item.derialize(bu); ++idx; } } }