diff --git a/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsResultsScreen.cs b/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsResultsScreen.cs index 95dab61d7b..61d49e4018 100644 --- a/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsResultsScreen.cs +++ b/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsResultsScreen.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Net; using JetBrains.Annotations; @@ -227,13 +226,11 @@ namespace osu.Game.Tests.Visual.Playlists private MultiplayerScore createUserResponse([NotNull] ScoreInfo userScore) { - Debug.Assert(userScore.Date != null); - var multiplayerUserScore = new MultiplayerScore { ID = (int)(userScore.OnlineScoreID ?? currentScoreId++), Accuracy = userScore.Accuracy, - EndedAt = userScore.Date.Value, + EndedAt = userScore.Date, Passed = userScore.Passed, Rank = userScore.Rank, Position = 200, @@ -254,7 +251,7 @@ namespace osu.Game.Tests.Visual.Playlists { ID = currentScoreId++, Accuracy = userScore.Accuracy, - EndedAt = userScore.Date.Value, + EndedAt = userScore.Date, Passed = true, Rank = userScore.Rank, MaxCombo = userScore.MaxCombo, @@ -272,7 +269,7 @@ namespace osu.Game.Tests.Visual.Playlists { ID = currentScoreId++, Accuracy = userScore.Accuracy, - EndedAt = userScore.Date.Value, + EndedAt = userScore.Date, Passed = true, Rank = userScore.Rank, MaxCombo = userScore.MaxCombo, diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs index 324d82b9c2..736366fb5c 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs @@ -2,7 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using System; -using System.Diagnostics; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -137,11 +136,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { set { - Debug.Assert(value.Date != null); - avatar.User = value.User; flag.Country = value.User.Country; - achievedOn.Date = value.Date.Value; + achievedOn.Date = value.Date; usernameText.Clear(); usernameText.AddUserLink(value.User); diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs index ec02273a99..713303285a 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.Diagnostics; using System.Linq; using JetBrains.Annotations; using osu.Framework.Allocation; @@ -45,8 +44,6 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks [BackgroundDependencyLoader] private void load() { - Debug.Assert(Score.Date != null); - AddInternal(new ProfileItemContainer { Children = new Drawable[] @@ -95,7 +92,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular), Colour = colours.Yellow }, - new DrawableDate(Score.Date.Value, 12) + new DrawableDate(Score.Date, 12) { Colour = colourProvider.Foreground1 } diff --git a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs index 0a405a9933..288552879c 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs @@ -59,7 +59,7 @@ namespace osu.Game.Scoring.Legacy sw.Write((int)score.ScoreInfo.Ruleset.CreateInstance().ConvertToLegacyMods(score.ScoreInfo.Mods)); sw.Write(getHpGraphFormatted()); - sw.Write((score.ScoreInfo.Date ?? DateTimeOffset.Now).DateTime); + sw.Write(score.ScoreInfo.Date.DateTime); sw.WriteByteArray(createReplayData()); sw.Write((long)0); writeModSpecificData(score.ScoreInfo, sw); diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs index d2df0058d8..a0c4d5a026 100644 --- a/osu.Game/Scoring/ScoreInfo.cs +++ b/osu.Game/Scoring/ScoreInfo.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; -using JetBrains.Annotations; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using osu.Game.Beatmaps; @@ -156,8 +155,7 @@ namespace osu.Game.Scoring public long? OnlineScoreID { get; set; } [JsonIgnore] - [CanBeNull] // may be null in cases of autoplay. - public DateTimeOffset? Date { get; set; } + public DateTimeOffset Date { get; set; } [JsonProperty("statistics")] public Dictionary Statistics = new Dictionary();