Beispiel #1
0
    //Protobuffer从MemoryStream进行反序列化
    public bool FromMemoryStream(MemoryStream protoMS)
    {
        SkillRpcTalentLvUpAsk pb = ProtoBuf.Serializer.Deserialize <SkillRpcTalentLvUpAsk>(protoMS);

        FromPB(pb);
        return(true);
    }
Beispiel #2
0
    //转化成Protobuffer类型函数
    public SkillRpcTalentLvUpAsk ToPB()
    {
        SkillRpcTalentLvUpAsk v = new SkillRpcTalentLvUpAsk();

        for (int i = 0; i < (int)m_Talent.Count; i++)
        {
            v.Talent.Add(m_Talent[i].ToPB());
        }

        return(v);
    }
Beispiel #3
0
 //从Protobuffer类型初始化
 public void FromPB(SkillRpcTalentLvUpAsk v)
 {
     if (v == null)
     {
         return;
     }
     m_Talent.Clear();
     for (int i = 0; i < v.Talent.Count; i++)
     {
         m_Talent.Add(new SkillRpcTalentLvObjWraper());
     }
     for (int i = 0; i < v.Talent.Count; i++)
     {
         m_Talent[i].FromPB(v.Talent[i]);
     }
 }