141 lines
3.2 KiB
C#
141 lines
3.2 KiB
C#
namespace ChessCubing.Server.Stats;
|
|
|
|
public sealed class ReportCompletedMatchRequest
|
|
{
|
|
public string MatchId { get; init; } = string.Empty;
|
|
|
|
public string? CollaborationSessionId { get; init; }
|
|
|
|
public string? WhiteSubject { get; init; }
|
|
|
|
public string WhiteName { get; init; } = string.Empty;
|
|
|
|
public string? BlackSubject { get; init; }
|
|
|
|
public string BlackName { get; init; } = string.Empty;
|
|
|
|
public string Result { get; init; } = string.Empty;
|
|
|
|
public string Mode { get; init; } = string.Empty;
|
|
|
|
public string Preset { get; init; } = string.Empty;
|
|
|
|
public string? MatchLabel { get; init; }
|
|
|
|
public int BlockNumber { get; init; }
|
|
|
|
public int WhiteMoves { get; init; }
|
|
|
|
public int BlackMoves { get; init; }
|
|
|
|
public ReportCompletedCubeRound[] CubeRounds { get; init; } = [];
|
|
}
|
|
|
|
public sealed class ReportCompletedCubeRound
|
|
{
|
|
public int BlockNumber { get; init; }
|
|
|
|
public int? Number { get; init; }
|
|
|
|
public long? White { get; init; }
|
|
|
|
public long? Black { get; init; }
|
|
}
|
|
|
|
public sealed class ReportCompletedMatchResponse
|
|
{
|
|
public bool Recorded { get; init; }
|
|
|
|
public bool IsDuplicate { get; init; }
|
|
|
|
public bool IsRanked { get; init; }
|
|
|
|
public int? WhiteEloAfter { get; init; }
|
|
|
|
public int? BlackEloAfter { get; init; }
|
|
}
|
|
|
|
public sealed class UserStatsResponse
|
|
{
|
|
public string Subject { get; init; } = string.Empty;
|
|
|
|
public int CurrentElo { get; init; }
|
|
|
|
public int RankedGames { get; init; }
|
|
|
|
public int CasualGames { get; init; }
|
|
|
|
public int Wins { get; init; }
|
|
|
|
public int Losses { get; init; }
|
|
|
|
public int StoppedGames { get; init; }
|
|
|
|
public int WhiteWins { get; init; }
|
|
|
|
public int BlackWins { get; init; }
|
|
|
|
public int WhiteLosses { get; init; }
|
|
|
|
public int BlackLosses { get; init; }
|
|
|
|
public int TotalMoves { get; init; }
|
|
|
|
public int TotalCubeRounds { get; init; }
|
|
|
|
public long? BestCubeTimeMs { get; init; }
|
|
|
|
public long? AverageCubeTimeMs { get; init; }
|
|
|
|
public DateTime? LastMatchUtc { get; init; }
|
|
|
|
public UserRecentMatchResponse[] RecentMatches { get; init; } = [];
|
|
}
|
|
|
|
public sealed class UserRecentMatchResponse
|
|
{
|
|
public string MatchId { get; init; } = string.Empty;
|
|
|
|
public DateTime CompletedUtc { get; init; }
|
|
|
|
public string Result { get; init; } = string.Empty;
|
|
|
|
public string Mode { get; init; } = string.Empty;
|
|
|
|
public string Preset { get; init; } = string.Empty;
|
|
|
|
public string? MatchLabel { get; init; }
|
|
|
|
public string PlayerColor { get; init; } = string.Empty;
|
|
|
|
public string PlayerName { get; init; } = string.Empty;
|
|
|
|
public string OpponentName { get; init; } = string.Empty;
|
|
|
|
public string? OpponentSubject { get; init; }
|
|
|
|
public bool IsRanked { get; init; }
|
|
|
|
public bool IsWin { get; init; }
|
|
|
|
public bool IsLoss { get; init; }
|
|
|
|
public int PlayerMoves { get; init; }
|
|
|
|
public int OpponentMoves { get; init; }
|
|
|
|
public int CubeRounds { get; init; }
|
|
|
|
public long? PlayerBestCubeTimeMs { get; init; }
|
|
|
|
public long? PlayerAverageCubeTimeMs { get; init; }
|
|
|
|
public int? EloBefore { get; init; }
|
|
|
|
public int? EloAfter { get; init; }
|
|
|
|
public int? EloDelta { get; init; }
|
|
}
|
|
|
|
public sealed class PlayerStatsValidationException(string message) : Exception(message);
|