예제 #1
0
    /// <summary>
    /// 更新
    /// </summary>
    public void Update(st.net.NetBase.endless_list data)
    {
        this.id = (int)data.chpter_id;
        int eid = 0;

        for (int i = 0; i < data.pass_list.Count; i++)
        {
            st.net.NetBase.pass_list item = data.pass_list[i];
            eid = (int)item.pass_id;
            if (!itemsList.ContainsKey(eid))
            {
                itemsList[eid] = new EndLessTrialsItemData(item);
            }
            else
            {
                itemsList[eid].Update(item);
            }
        }
        for (int i = 0; i < data.pass_star_list.Count; i++)
        {
            st.net.NetBase.pass_star_list item = data.pass_star_list[i];
            eid = (int)item.star_id;
            if (!starsList.ContainsKey(eid))
            {
                starsList[eid] = new EndLessTrialsStarData(item);
            }
            else
            {
                starsList[eid].Update(item);
            }
        }
    }
예제 #2
0
    public override byte[] toBinary()
    {
        writer = new st.net.NetBase.ByteWriter();
        ushort lenendless_list = (ushort)endless_list.Count;

        writer.write_short(lenendless_list);
        for (int i_endless_list = 0; i_endless_list < lenendless_list; i_endless_list++)
        {
            st.net.NetBase.endless_list listData = endless_list[i_endless_list];
            listData.toBinary(writer);
        }
        writer.write_int(reset_num);
        return(writer.data);
    }
예제 #3
0
    public override void fromBinary(byte[] binary)
    {
        reader = new st.net.NetBase.ByteReader(binary);
        ushort lenendless_list = reader.Read_ushort();

        endless_list = new List <st.net.NetBase.endless_list>();
        for (int i_endless_list = 0; i_endless_list < lenendless_list; i_endless_list++)
        {
            st.net.NetBase.endless_list listData = new st.net.NetBase.endless_list();
            listData.fromBinary(reader);
            endless_list.Add(listData);
        }
        reset_num = reader.Read_int();
    }
예제 #4
0
 /// <summary>
 /// 构造
 /// </summary>
 public EndLessTrialsDataInfo(st.net.NetBase.endless_list data)
 {
     Update(data);
 }