PlayerInfo.dart 864 B

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