Пример #1
0
    //Protobuffer从MemoryStream进行反序列化
    public bool FromMemoryStream(MemoryStream protoMS)
    {
        ActivityScheduleRpcThiefRefreshNotify pb = ProtoBuf.Serializer.Deserialize <ActivityScheduleRpcThiefRefreshNotify>(protoMS);

        FromPB(pb);
        return(true);
    }
Пример #2
0
    //转化成Protobuffer类型函数
    public ActivityScheduleRpcThiefRefreshNotify ToPB()
    {
        ActivityScheduleRpcThiefRefreshNotify v = new ActivityScheduleRpcThiefRefreshNotify();

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

        return(v);
    }
Пример #3
0
 //从Protobuffer类型初始化
 public void FromPB(ActivityScheduleRpcThiefRefreshNotify v)
 {
     if (v == null)
     {
         return;
     }
     m_ThiefData.Clear();
     for (int i = 0; i < v.ThiefData.Count; i++)
     {
         m_ThiefData.Add(new ActivityNpcDataWraper());
     }
     for (int i = 0; i < v.ThiefData.Count; i++)
     {
         m_ThiefData[i].FromPB(v.ThiefData[i]);
     }
 }