//Protobuffer从MemoryStream进行反序列化 public bool FromMemoryStream(MemoryStream protoMS) { BaseAttrRpcQueryEquipAsk pb = ProtoBuf.Serializer.Deserialize <BaseAttrRpcQueryEquipAsk>(protoMS); FromPB(pb); return(true); }
//从Protobuffer类型初始化 public void FromPB(BaseAttrRpcQueryEquipAsk v) { if (v == null) { return; } m_UserId = v.UserId; m_Pos = v.Pos; m_TemplateID = v.TemplateID; m_Index = v.Index; }
//转化成Protobuffer类型函数 public BaseAttrRpcQueryEquipAsk ToPB() { BaseAttrRpcQueryEquipAsk v = new BaseAttrRpcQueryEquipAsk(); v.UserId = m_UserId; v.Pos = m_Pos; v.TemplateID = m_TemplateID; v.Index = m_Index; return(v); }