PlayerInfo.dart 957 B

12345678910111213141516171819202122232425262728293031323334
  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);
  10. int id;
  11. int houseId; //房间id
  12. int userId; //用户id
  13. int statusFlag; //状态 0加入 1准备 2开始 3结束 6未比赛
  14. UserInfo userInfo;
  15. int bonus;//奖金
  16. GameInfo gameInfo;
  17. HouseInfo houseInfo;
  18. int rank;//名次
  19. int houseRank;//房间比赛名次
  20. String video;//视频地址
  21. factory PlayerInfo.fromJson(Map<String, dynamic> json) =>
  22. _$PlayerInfoFromJson(json);
  23. Map<String, dynamic> toJson() => _$PlayerInfoToJson(this);
  24. // 命名构造函数
  25. PlayerInfo.empty();
  26. @override
  27. String toString() {
  28. return _$PlayerInfoToJson(this).toString();
  29. }
  30. }