//Protobuffer从MemoryStream进行反序列化 public bool FromMemoryStream(MemoryStream protoMS) { OneVSOneRpcGetSkillReply pb = ProtoBuf.Serializer.Deserialize <OneVSOneRpcGetSkillReply>(protoMS); FromPB(pb); return(true); }
//转化成Protobuffer类型函数 public OneVSOneRpcGetSkillReply ToPB() { OneVSOneRpcGetSkillReply v = new OneVSOneRpcGetSkillReply(); v.Result = m_Result; for (int i = 0; i < (int)m_SkillDate.Count; i++) { v.SkillDate.Add(m_SkillDate[i].ToPB()); } return(v); }
//从Protobuffer类型初始化 public void FromPB(OneVSOneRpcGetSkillReply v) { if (v == null) { return; } m_Result = v.Result; m_SkillDate.Clear(); for (int i = 0; i < v.SkillDate.Count; i++) { m_SkillDate.Add(new OneSDataWraper()); } for (int i = 0; i < v.SkillDate.Count; i++) { m_SkillDate[i].FromPB(v.SkillDate[i]); } }