public override byte[] toBinary() { writer = new st.net.NetBase.ByteWriter(); ushort lensingle_many_list = (ushort)single_many_list.Count; writer.write_short(lensingle_many_list); for (int i_single_many_list = 0; i_single_many_list < lensingle_many_list; i_single_many_list++) { st.net.NetBase.single_many_list listData = single_many_list[i_single_many_list]; listData.toBinary(writer); } return(writer.data); }
public override void fromBinary(byte[] binary) { reader = new st.net.NetBase.ByteReader(binary); ushort lensingle_many_list = reader.Read_ushort(); single_many_list = new List <st.net.NetBase.single_many_list>(); for (int i_single_many_list = 0; i_single_many_list < lensingle_many_list; i_single_many_list++) { st.net.NetBase.single_many_list listData = new st.net.NetBase.single_many_list(); listData.fromBinary(reader); single_many_list.Add(listData); } }
/// <summary> /// 更新 /// </summary> public void UpdateData(st.net.NetBase.single_many_list info) { id = (int)info.copy_id; num = (int)info.challenge_num; buyNum = (int)info.buy_num; for (int i = 0; i < info.single_many_star.Count; i++) { st.net.NetBase.single_many_star data = info.single_many_star[i]; if (copyScenes.ContainsKey((int)data.copy_type)) { copyScenes[(int)data.copy_type].UpdateData(data); } else { copyScenes[(int)data.copy_type] = new CopySceneData(data); } } }
/// <summary> /// 构造 /// </summary> public CopyInItemDataInfo(st.net.NetBase.single_many_list info) { UpdateData(info); }