Merge branch 'master' into fix-d-rank

This commit is contained in:
Dean Herbert
2018-11-30 19:49:36 +09:00
committed by GitHub
26 changed files with 130 additions and 77 deletions

View File

@ -45,7 +45,7 @@ namespace osu.Game.Scoring.Legacy
currentBeatmap = workingBeatmap.Beatmap;
score.ScoreInfo.Beatmap = currentBeatmap.BeatmapInfo;
score.ScoreInfo.User = score.Replay.User = new User { Username = sr.ReadString() };
score.ScoreInfo.User = new User { Username = sr.ReadString() };
// MD5Hash
sr.ReadString();

View File

@ -44,7 +44,8 @@ namespace osu.Game.Scoring
{
get
{
if (mods != null) return mods;
if (mods != null)
return mods;
if (modsJson == null)
return Array.Empty<Mod>();
@ -65,7 +66,16 @@ namespace osu.Game.Scoring
[Column("Mods")]
public string ModsJson
{
get => modsJson ?? (modsJson = JsonConvert.SerializeObject(mods));
get
{
if (modsJson != null)
return modsJson;
if (mods == null)
return null;
return modsJson = JsonConvert.SerializeObject(mods);
}
set
{
modsJson = value;

View File

@ -57,6 +57,8 @@ namespace osu.Game.Scoring
public List<ScoreInfo> GetAllUsableScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending).ToList();
public IEnumerable<ScoreInfo> QueryScores(Expression<Func<ScoreInfo, bool>> query) => ModelStore.ConsumableItems.AsNoTracking().Where(query);
public ScoreInfo Query(Expression<Func<ScoreInfo, bool>> query) => ModelStore.ConsumableItems.AsNoTracking().FirstOrDefault(query);
}
}