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

        FromPB(pb);
        return(true);
    }
Exemple #2
0
 //从Protobuffer类型初始化
 public void FromPB(CapsuleItemObj v)
 {
     if (v == null)
     {
         return;
     }
     m_ItemId = v.ItemId;
     m_Count  = v.Count;
 }
Exemple #3
0
    //转化成Protobuffer类型函数
    public CapsuleItemObj ToPB()
    {
        CapsuleItemObj v = new CapsuleItemObj();

        v.ItemId = m_ItemId;
        v.Count  = m_Count;

        return(v);
    }