//Protobuffer从MemoryStream进行反序列化 public bool FromMemoryStream(MemoryStream protoMS) { BaseAttrBuffCdInfoV1 pb = ProtoBuf.Serializer.Deserialize <BaseAttrBuffCdInfoV1>(protoMS); FromPB(pb); return(true); }
//从Protobuffer类型初始化 public void FromPB(BaseAttrBuffCdInfoV1 v) { if (v == null) { return; } m_BuffId = v.BuffId; m_EndTime = v.EndTime; }
//转化成Protobuffer类型函数 public BaseAttrBuffCdInfoV1 ToPB() { BaseAttrBuffCdInfoV1 v = new BaseAttrBuffCdInfoV1(); v.BuffId = m_BuffId; v.EndTime = m_EndTime; return(v); }