GetFashionShowData.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 GetFashionShowData()
  20. {
  21. }
  22. public GetFashionShowData(GetFashionShowData data)
  23. {
  24. playerId = data.playerId;
  25. title = data.title;
  26. content = data.content;
  27. head = data.head;
  28. headwear = data.headwear;
  29. eye = data.eye;
  30. mouth = data.mouth;
  31. top = data.top;
  32. skirt = data.skirt;
  33. shoe = data.shoe;
  34. wing = data.wing;
  35. showId = data.showId;
  36. cuteScore = data.cuteScore;
  37. vividScore = data.vividScore;
  38. simpleScore = data.simpleScore;
  39. graceScore = data.graceScore;
  40. gloryScore = data.gloryScore;
  41. scoreCnt = data.scoreCnt;
  42. praiseCnt = data.praiseCnt;
  43. praised = data.praised;
  44. playerNickName = data.playerNickName;
  45. }
  46. public GetFashionShowData(JsonData data)
  47. {
  48. playerId = long.Parse((string) data["user_id"]);
  49. title = (string) data["title"];
  50. content = (string) data["content"];
  51. head = (int)data["head"];
  52. headwear = (int)data["headwear"];
  53. eye = (int)data["eyes"];
  54. mouth = (int)data["mouth"];
  55. top = (int)data["clothes"];
  56. skirt = (int)data["skirt"];
  57. shoe = (int)data["shoes"];
  58. wing = (int)data["wing"];
  59. showId = (int) data["id"];
  60. cuteScore = (int) data["score1"];
  61. graceScore = (int) data["score2"];
  62. vividScore = (int) data["score3"];
  63. simpleScore = (int) data["score4"];
  64. gloryScore = (int) data["score5"];
  65. scoreCnt = (int) data["num_scored"];
  66. praiseCnt = (int) data["likes"];
  67. praised = ((int) data["liked"]).ToBool();
  68. playerNickName = (string)data["nickname"];
  69. }
  70. public float GetCuteRate()
  71. {
  72. return (float) cuteScore/scoreCnt;
  73. }
  74. public float GetVividRate()
  75. {
  76. return (float) vividScore/scoreCnt;
  77. }
  78. public float GetSimpleRate()
  79. {
  80. return (float) simpleScore/scoreCnt;
  81. }
  82. public float GetGloryRate()
  83. {
  84. return (float) graceScore/scoreCnt;
  85. }
  86. public float GetGraceRate()
  87. {
  88. return (float) gloryScore/scoreCnt;
  89. }
  90. }