mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Move responsibility for selecting paths to model managers
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user