YotogiSkillData.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using System;
  2. using System.IO;
  3. using wf;
  4. using Yotogis;
  5. namespace MaidStatus
  6. {
  7. public class YotogiSkillData
  8. {
  9. public int id
  10. {
  11. get
  12. {
  13. return (this.data == null) ? this.oldData.id : this.data.id;
  14. }
  15. }
  16. public uint playCount
  17. {
  18. get
  19. {
  20. return this.playCount_;
  21. }
  22. set
  23. {
  24. this.playCount_ = (uint)wf.Math.RoundMinMax((long)((ulong)value), 0L, (long)((ulong)-1));
  25. }
  26. }
  27. public int commandCount
  28. {
  29. get
  30. {
  31. return (int)this.commandCount_;
  32. }
  33. set
  34. {
  35. this.commandCount_ = (ushort)wf.Math.RoundMinMax(value, 0, 65535);
  36. }
  37. }
  38. public int level
  39. {
  40. get
  41. {
  42. return this.expSystem.GetCurrentLevel();
  43. }
  44. }
  45. public int currentExp
  46. {
  47. get
  48. {
  49. return this.expSystem.GetCurrentExp();
  50. }
  51. }
  52. public int nextExp
  53. {
  54. get
  55. {
  56. return this.expSystem.GetNextLevelExp(this.level);
  57. }
  58. }
  59. public void Serialize(BinaryWriter binary)
  60. {
  61. binary.Write(this.playCount_);
  62. binary.Write(this.commandCount_);
  63. binary.Write(this.lockSkillExp);
  64. this.expSystem.Serialize(binary);
  65. }
  66. public void Deserialize(BinaryReader binary, int version)
  67. {
  68. this.playCount_ = binary.ReadUInt32();
  69. this.commandCount_ = binary.ReadUInt16();
  70. if (213 < version)
  71. {
  72. this.lockSkillExp = binary.ReadBoolean();
  73. }
  74. this.expSystem.Deserialize(binary, version);
  75. }
  76. public Skill.Data data;
  77. public Skill.Old.Data oldData;
  78. public SimpleExperienceSystem expSystem = new SimpleExperienceSystem();
  79. public bool lockSkillExp;
  80. private uint playCount_;
  81. private ushort commandCount_;
  82. }
  83. }