GetFashionShowData.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using LitJson;
  6. using UnityEngine;
  7. public class GetFashionShowData : FashionShowData
  8. {
  9. public int showId;
  10. public int cuteScore;
  11. public int vividScore;
  12. public int simpleScore;
  13. public int graceScore;
  14. public int gloryScore;
  15. public int scoreCnt;
  16. public int praiseCnt;
  17. public bool praised;
  18. public string playerNickName;
  19. public bool rated;
  20. public GetFashionShowData()
  21. {
  22. }
  23. public GetFashionShowData(GetFashionShowData data)
  24. {
  25. playerId = data.playerId;
  26. title = data.title;
  27. content = data.content;
  28. head = data.head;
  29. headwear = data.headwear;
  30. eye = data.eye;
  31. mouth = data.mouth;
  32. top = data.top;
  33. skirt = data.skirt;
  34. shoe = data.shoe;
  35. wing = data.wing;
  36. showId = data.showId;
  37. cuteScore = data.cuteScore;
  38. vividScore = data.vividScore;
  39. simpleScore = data.simpleScore;
  40. graceScore = data.graceScore;
  41. gloryScore = data.gloryScore;
  42. scoreCnt = data.scoreCnt;
  43. praiseCnt = data.praiseCnt;
  44. praised = data.praised;
  45. playerNickName = data.playerNickName;
  46. }
  47. public GetFashionShowData(JsonData data)
  48. {
  49. playerId = long.Parse(data["user_id"].ToString());
  50. title = (string) data["title"];
  51. content = (string) data["content"];
  52. head = (int) data["head"];
  53. headwear = (int) data["headwear"];
  54. eye = (int) data["eyes"];
  55. mouth = (int) data["mouth"];
  56. top = (int) data["clothes"];
  57. skirt = (int) data["skirt"];
  58. shoe = (int) data["shoes"];
  59. wing = (int) data["wing"];
  60. showId = (int) data["id"];
  61. cuteScore = (int) data["score1"];
  62. graceScore = (int) data["score2"];
  63. vividScore = (int) data["score3"];
  64. simpleScore = (int) data["score4"];
  65. gloryScore = (int) data["score5"];
  66. scoreCnt = (int) data["num_scored"];
  67. praiseCnt = (int) data["likes"];
  68. praised = ((int) data["liked"]).ToBool();
  69. playerNickName = (string) data["nickname"];
  70. rated = ((int) data["scored"]).ToBool();
  71. }
  72. public float GetCuteRate()
  73. {
  74. return (float) cuteScore/scoreCnt;
  75. }
  76. public float GetVividRate()
  77. {
  78. return (float) vividScore/scoreCnt;
  79. }
  80. public float GetSimpleRate()
  81. {
  82. return (float) simpleScore/scoreCnt;
  83. }
  84. public float GetGloryRate()
  85. {
  86. return (float) gloryScore/scoreCnt;
  87. }
  88. public float GetGraceRate()
  89. {
  90. return (float) graceScore/scoreCnt;
  91. }
  92. }