import 'package:json_annotation/json_annotation.dart';
import 'UserInfo.dart';
import 'GameInfo.dart';
import 'HouseInfo.dart';

part 'PlayerInfo.g.dart';

@JsonSerializable()
class PlayerInfo {
  PlayerInfo(
      this.id, this.houseId, this.userId, this.statusFlag, this.userInfo,this.bonus,this.gameInfo,this.houseInfo,this.rank,this.houseRank,this.video);
  int id;
  int houseId; //房间id
  int userId; //用户id
  int statusFlag; //状态 0加入 1准备 2开始 3结束 6未比赛
  UserInfo userInfo;
  int bonus;//奖金
  GameInfo gameInfo;
  HouseInfo houseInfo;
  int rank;//名次
  int houseRank;//房间比赛名次
  String video;//视频地址
  
  factory PlayerInfo.fromJson(Map<String, dynamic> json) =>
      _$PlayerInfoFromJson(json);

  Map<String, dynamic> toJson() => _$PlayerInfoToJson(this);
  // 命名构造函数
  PlayerInfo.empty();
  @override
  String toString() {
    return _$PlayerInfoToJson(this).toString();
  }
}
