ModelApiResponse.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using System;
  2. using System.Collections.Generic;
  3. using HttpApi;
  4. namespace Api
  5. {
  6. [Serializable]
  7. public class ModelApiResponse
  8. {
  9. public int code;
  10. public string err;
  11. public ResponseSuccessData data;
  12. }
  13. [Serializable]
  14. public class ModelBattleDetailListApiResponse
  15. {
  16. public int code;
  17. public string err;
  18. public BattleDetailListObj data;
  19. }
  20. [Serializable]
  21. public class PlayerInfo
  22. {
  23. public string avatar;
  24. public int diamond;
  25. public string name;
  26. public int id;
  27. public int playerId;
  28. }
  29. [Serializable]
  30. public class ResponseSuccessData
  31. {
  32. public string session;
  33. public List<Msg> msgs;
  34. public List<PlayerInfo> players;
  35. public List<Cock> playerCocks;
  36. public List<MarketCock> market;
  37. public List<CockType> cockTypes;
  38. // 查询用户信息用
  39. public string name;
  40. public string icon;
  41. public PlayerInfo selfInfo;
  42. // 对战
  43. public BattleDetailListObj battleInfo;
  44. }
  45. [Serializable]
  46. public class MarketCock
  47. {
  48. public int marketId;
  49. public int cockId;
  50. public int times;
  51. public int diamond;
  52. }
  53. [Serializable]
  54. public class Cock
  55. {
  56. public int cockId;
  57. public int times;
  58. }
  59. [Serializable]
  60. public class CockType
  61. {
  62. public int id;
  63. public string name;
  64. public float atkStar;
  65. public float hpStar;
  66. public float intervalStar;
  67. }
  68. [Serializable]
  69. public class Msg
  70. {
  71. public int msgFromPlayer;
  72. public string id;
  73. public int type;
  74. public MsgContent content;
  75. }
  76. public static class MsgContentType
  77. {
  78. public static readonly string ChooseCock = "ChooseCock";
  79. public static readonly string SelectDiamond = "SelectDiamond";
  80. }
  81. [Serializable]
  82. public class MsgContent
  83. {
  84. //这2个字段用来战斗中的消息
  85. public string contentType;
  86. public int cockId;
  87. public int diamond;
  88. //下面是准备信息
  89. public string battleSession;
  90. public long bid;
  91. public PlayerInfo invitePlayer;
  92. public int from;
  93. public int to;
  94. public int fromCockId;
  95. public int toCockId;
  96. public bool fromPlayerReady;
  97. public bool toPlayerReady;
  98. public bool winPlayer;
  99. }
  100. }