mchess-client/lib/api/register.dart

31 lines
759 B
Dart

import 'package:uuid/uuid.dart';
class ResponseFromRegisteringGame {
final UuidValue playerID;
final UuidValue lobbyID;
const ResponseFromRegisteringGame({
required this.playerID,
required this.lobbyID,
});
factory ResponseFromRegisteringGame.fromJson(Map<String, dynamic> json) {
final playerid = UuidValue(json['playerID']);
final lobbyid = UuidValue(json['lobbyID']);
return ResponseFromRegisteringGame(playerID: playerid, lobbyID: lobbyid);
}
}
class WebsocketMessageIdentifyPlayer {
final String playerID;
final String lobbyID;
const WebsocketMessageIdentifyPlayer({
required this.playerID,
required this.lobbyID,
});
Map<String, dynamic> toJson() => {'lobbyID': lobbyID, 'playerID': playerID};
}