Move responsibility for selecting paths to model managers

This commit is contained in:
HoLLy
2019-06-21 17:32:47 +02:00
parent f1f03dd541
commit 802da225d4
4 changed files with 16 additions and 20 deletions

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using Microsoft.EntityFrameworkCore;
@ -24,8 +25,6 @@ namespace osu.Game.Scoring
protected override string ImportFromStablePath => @"Data\r";
protected override bool StableDirectoryBased => false;
private readonly RulesetStore rulesets;
private readonly Func<BeatmapManager> beatmaps;
@ -55,6 +54,10 @@ namespace osu.Game.Scoring
}
}
protected override IEnumerable<string> GetStableImportPaths()
=> GetStableStorage().GetFiles(ImportFromStablePath)
.Where(p => HandledExtensions.Any(ext => Path.GetExtension(p)?.Equals(ext, StringComparison.InvariantCultureIgnoreCase) ?? false));
public Score GetScore(ScoreInfo score) => new LegacyDatabasedScore(score, rulesets, beatmaps(), Files.Store);
public List<ScoreInfo> GetAllUsableScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending).ToList();