PlayerInfo.dart 916 B

123456789101112131415161718192021222324252627282930313233
  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);
  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. factory PlayerInfo.fromJson(Map<String, dynamic> json) =>
  21. _$PlayerInfoFromJson(json);
  22. Map<String, dynamic> toJson() => _$PlayerInfoToJson(this);
  23. // 命名构造函数
  24. PlayerInfo.empty();
  25. @override
  26. String toString() {
  27. return _$PlayerInfoToJson(this).toString();
  28. }
  29. }