Ajoute l Elo et les statistiques de parties
This commit is contained in:
@@ -45,11 +45,20 @@ public sealed class MatchConfig
|
||||
public sealed class MatchState
|
||||
{
|
||||
[JsonPropertyName("schemaVersion")]
|
||||
public int SchemaVersion { get; set; } = 3;
|
||||
public int SchemaVersion { get; set; } = 4;
|
||||
|
||||
[JsonPropertyName("matchId")]
|
||||
public string MatchId { get; set; } = Guid.NewGuid().ToString("N");
|
||||
|
||||
[JsonPropertyName("collaborationSessionId")]
|
||||
public string? CollaborationSessionId { get; set; }
|
||||
|
||||
[JsonPropertyName("whiteSubject")]
|
||||
public string? WhiteSubject { get; set; }
|
||||
|
||||
[JsonPropertyName("blackSubject")]
|
||||
public string? BlackSubject { get; set; }
|
||||
|
||||
[JsonPropertyName("config")]
|
||||
public MatchConfig Config { get; set; } = new();
|
||||
|
||||
@@ -95,6 +104,9 @@ public sealed class MatchState
|
||||
[JsonPropertyName("result")]
|
||||
public string? Result { get; set; }
|
||||
|
||||
[JsonPropertyName("resultRecordedUtc")]
|
||||
public DateTime? ResultRecordedUtc { get; set; }
|
||||
|
||||
[JsonPropertyName("cube")]
|
||||
public CubeState Cube { get; set; } = new();
|
||||
|
||||
|
||||
138
ChessCubing.App/Models/Stats/UserStatsModels.cs
Normal file
138
ChessCubing.App/Models/Stats/UserStatsModels.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
namespace ChessCubing.App.Models.Stats;
|
||||
|
||||
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 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; }
|
||||
}
|
||||
Reference in New Issue
Block a user