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

        FromPB(pb);
        return(true);
    }
Ejemplo n.º 2
0
    //转化成Protobuffer类型函数
    public TaskTaskDataV1 ToPB()
    {
        TaskTaskDataV1 v = new TaskTaskDataV1();

        for (int i = 0; i < (int)m_AllTaskArray.Count; i++)
        {
            v.AllTaskArray.Add(m_AllTaskArray[i].ToPB());
        }
        for (int i = 0; i < (int)m_UnacceptedTaskArray.Count; i++)
        {
            v.UnacceptedTaskArray.Add(m_UnacceptedTaskArray[i].ToPB());
        }
        v.ProfTaskId        = m_ProfTaskId;
        v.ProfTaskCompCount = m_ProfTaskCompCount;
        for (int i = 0; i < (int)m_OneDragonTaskId.Count; i++)
        {
            v.OneDragonTaskId.Add(m_OneDragonTaskId[i]);
        }
        v.OneDragonRingNum       = m_OneDragonRingNum;
        v.OneDragonComplateCount = m_OneDragonComplateCount;
        v.OneDragonDungeonId     = m_OneDragonDungeonId;
        v.GuildSpyComplateCount  = m_GuildSpyComplateCount;

        return(v);
    }
Ejemplo n.º 3
0
 //从Protobuffer类型初始化
 public void FromPB(TaskTaskDataV1 v)
 {
     if (v == null)
     {
         return;
     }
     m_AllTaskArray.Clear();
     for (int i = 0; i < v.AllTaskArray.Count; i++)
     {
         m_AllTaskArray.Add(new TaskTaskObjWraperV1());
     }
     for (int i = 0; i < v.AllTaskArray.Count; i++)
     {
         m_AllTaskArray[i].FromPB(v.AllTaskArray[i]);
     }
     m_UnacceptedTaskArray.Clear();
     for (int i = 0; i < v.UnacceptedTaskArray.Count; i++)
     {
         m_UnacceptedTaskArray.Add(new TaskUnacceptedTaskObjWraperV1());
     }
     for (int i = 0; i < v.UnacceptedTaskArray.Count; i++)
     {
         m_UnacceptedTaskArray[i].FromPB(v.UnacceptedTaskArray[i]);
     }
     m_ProfTaskId        = v.ProfTaskId;
     m_ProfTaskCompCount = v.ProfTaskCompCount;
     m_OneDragonTaskId.Clear();
     for (int i = 0; i < v.OneDragonTaskId.Count; i++)
     {
         m_OneDragonTaskId.Add(v.OneDragonTaskId[i]);
     }
     m_OneDragonRingNum       = v.OneDragonRingNum;
     m_OneDragonComplateCount = v.OneDragonComplateCount;
     m_OneDragonDungeonId     = v.OneDragonDungeonId;
     m_GuildSpyComplateCount  = v.GuildSpyComplateCount;
 }