BodyData.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using System;
  2. using System.IO;
  3. using wf;
  4. namespace MaidStatus
  5. {
  6. public class BodyData
  7. {
  8. public int height
  9. {
  10. get
  11. {
  12. return (int)this.height_;
  13. }
  14. set
  15. {
  16. this.height_ = (ushort)wf.Math.Round4(value);
  17. }
  18. }
  19. public int weight
  20. {
  21. get
  22. {
  23. return (int)this.weight_;
  24. }
  25. set
  26. {
  27. this.weight_ = (ushort)wf.Math.Round4(value);
  28. }
  29. }
  30. public int bust
  31. {
  32. get
  33. {
  34. return (int)this.bust_;
  35. }
  36. set
  37. {
  38. this.bust_ = (ushort)wf.Math.Round4(value);
  39. }
  40. }
  41. public int waist
  42. {
  43. get
  44. {
  45. return (int)this.waist_;
  46. }
  47. set
  48. {
  49. this.waist_ = (ushort)wf.Math.Round4(value);
  50. }
  51. }
  52. public int hip
  53. {
  54. get
  55. {
  56. return (int)this.hip_;
  57. }
  58. set
  59. {
  60. this.hip_ = (ushort)wf.Math.Round4(value);
  61. }
  62. }
  63. public string cup
  64. {
  65. get
  66. {
  67. return this.cup_;
  68. }
  69. set
  70. {
  71. this.cup_ = ((!string.IsNullOrEmpty(value)) ? value : string.Empty);
  72. }
  73. }
  74. public void Serialize(BinaryWriter binary)
  75. {
  76. binary.Write(this.height_);
  77. binary.Write(this.weight_);
  78. binary.Write(this.bust_);
  79. binary.Write(this.waist_);
  80. binary.Write(this.hip_);
  81. binary.Write(this.cup);
  82. }
  83. public void Deserialize(BinaryReader binary, int version)
  84. {
  85. this.height_ = binary.ReadUInt16();
  86. this.weight_ = binary.ReadUInt16();
  87. this.bust_ = binary.ReadUInt16();
  88. this.waist_ = binary.ReadUInt16();
  89. this.hip_ = binary.ReadUInt16();
  90. this.cup = binary.ReadString();
  91. }
  92. private ushort height_;
  93. private ushort weight_;
  94. private ushort bust_;
  95. private ushort waist_;
  96. private ushort hip_;
  97. private string cup_ = string.Empty;
  98. }
  99. }