ScheduleSlotBackup.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using System;
  2. using System.IO;
  3. namespace PlayerStatus
  4. {
  5. public class ScheduleSlotBackup
  6. {
  7. public ScheduleSlotBackup()
  8. {
  9. this.slotDataArray = new ScheduleSlotBackup.Data[40];
  10. for (int i = 0; i < 40; i++)
  11. {
  12. this.slotDataArray[i] = new ScheduleSlotBackup.Data();
  13. }
  14. }
  15. public static int BackUpMax
  16. {
  17. get
  18. {
  19. return 2;
  20. }
  21. }
  22. public void Serialize(BinaryWriter binary)
  23. {
  24. foreach (ScheduleSlotBackup.Data data in this.slotDataArray)
  25. {
  26. data.Serialize(binary);
  27. }
  28. }
  29. public void Deserialize(BinaryReader binary, int version, int slotCnt)
  30. {
  31. for (int i = 0; i < slotCnt; i++)
  32. {
  33. this.slotDataArray[i].Deserialize(binary, version);
  34. }
  35. }
  36. public ScheduleSlotBackup.Data[] slotDataArray;
  37. public enum Type
  38. {
  39. CM3D2,
  40. COM3D,
  41. Max
  42. }
  43. public class Data
  44. {
  45. public void Serialize(BinaryWriter binary)
  46. {
  47. binary.Write(this.maid_guid);
  48. binary.Write(this.noonWorkId);
  49. binary.Write(this.nightWorkId);
  50. binary.Write(this.noonCommu);
  51. binary.Write(this.nightCommu);
  52. }
  53. public void Deserialize(BinaryReader binary, int version)
  54. {
  55. this.maid_guid = binary.ReadString();
  56. this.noonWorkId = binary.ReadInt32();
  57. this.nightWorkId = binary.ReadInt32();
  58. this.noonCommu = binary.ReadBoolean();
  59. this.nightCommu = binary.ReadBoolean();
  60. }
  61. public string maid_guid = string.Empty;
  62. public int noonWorkId;
  63. public int nightWorkId;
  64. public bool noonCommu;
  65. public bool nightCommu;
  66. }
  67. }
  68. }