PlayerInfo.dart 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'package:json_annotation/json_annotation.dart';
  2. import 'UserInfo.dart';
  3. import 'GameInfo.dart';
  4. import 'HouseInfo.dart';
  5. part 'PlayerInfo.g.dart';
  6. @JsonSerializable()
  7. class PlayerInfo {
  8. PlayerInfo(
  9. this.id, this.houseId, this.userId, this.statusFlag, this.userInfo,this.bonus,this.gameInfo,this.houseInfo,this.rank,this.houseRank,this.video,this.platinum,this.gold,this.silver,this.bronze,this.medal,this.liveTime,this.score,this.ranking,this.beginTime,this.endTime,this.dataError,this.killNumber,this.needkill);
  10. int id;
  11. int houseId; //房间id
  12. int userId; //用户id
  13. int statusFlag; //状态 0加入 1准备 2开始 3结束 4结算 6未比赛 9.解析失败 7.超时
  14. UserInfo userInfo;
  15. num bonus;//奖金
  16. GameInfo gameInfo;
  17. HouseInfo houseInfo;
  18. int rank;//名次
  19. int houseRank;//房间比赛名次
  20. String video;//视频地址
  21. int platinum; //铂金
  22. int gold;//金牌
  23. int silver;//银牌
  24. int bronze;//铜牌
  25. String medal;//奖牌
  26. num liveTime;//存活时间
  27. num score;//评分
  28. int ranking;//是否吃鸡 1吃鸡
  29. int beginTime;//开始比赛时间
  30. int endTime;//结束比赛时间
  31. bool dataError;//数据异常
  32. int killNumber;//
  33. int needkill;
  34. factory PlayerInfo.fromJson(Map<String, dynamic> json) =>
  35. _$PlayerInfoFromJson(json);
  36. Map<String, dynamic> toJson() => _$PlayerInfoToJson(this);
  37. // 命名构造函数
  38. PlayerInfo.empty();
  39. String getPlatinum() {
  40. return this.platinum.toString();
  41. }
  42. String getGold() {
  43. return this.gold.toString();
  44. }
  45. String getSilver() {
  46. return this.silver.toString();
  47. }
  48. String getBronze() {
  49. return this.bronze.toString();
  50. }
  51. @override
  52. String toString() {
  53. return _$PlayerInfoToJson(this).toString();
  54. }
  55. }