GameSession.fromJson constructor
GameSession.fromJson(
- Map<String, dynamic> json
)
Implementation
factory GameSession.fromJson(Map<String, dynamic> json) {
return GameSession(
creationTime: timeStampFromJson(json['CreationTime']),
creatorId: json['CreatorId'] as String?,
currentPlayerSessionCount: json['CurrentPlayerSessionCount'] as int?,
dnsName: json['DnsName'] as String?,
fleetArn: json['FleetArn'] as String?,
fleetId: json['FleetId'] as String?,
gameProperties: (json['GameProperties'] as List?)
?.whereNotNull()
.map((e) => GameProperty.fromJson(e as Map<String, dynamic>))
.toList(),
gameSessionData: json['GameSessionData'] as String?,
gameSessionId: json['GameSessionId'] as String?,
ipAddress: json['IpAddress'] as String?,
matchmakerData: json['MatchmakerData'] as String?,
maximumPlayerSessionCount: json['MaximumPlayerSessionCount'] as int?,
name: json['Name'] as String?,
playerSessionCreationPolicy:
(json['PlayerSessionCreationPolicy'] as String?)
?.toPlayerSessionCreationPolicy(),
port: json['Port'] as int?,
status: (json['Status'] as String?)?.toGameSessionStatus(),
statusReason:
(json['StatusReason'] as String?)?.toGameSessionStatusReason(),
terminationTime: timeStampFromJson(json['TerminationTime']),
);
}