mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
make migrate public abstract in base and override
This commit is contained in:
@ -14,7 +14,7 @@ namespace osu.Game.Tournament.IO
|
||||
private readonly Storage storage;
|
||||
internal readonly TournamentVideoResourceStore VideoStore;
|
||||
private const string default_tournament = "default";
|
||||
|
||||
|
||||
public TournamentStorage(Storage storage)
|
||||
: base(storage.GetStorageForDirectory("tournaments"), string.Empty)
|
||||
{
|
||||
@ -30,7 +30,7 @@ namespace osu.Game.Tournament.IO
|
||||
}
|
||||
else
|
||||
{
|
||||
migrate();
|
||||
Migrate(GetFullPath(default_tournament));
|
||||
storageConfig.Set(StorageConfig.CurrentTournament, default_tournament);
|
||||
storageConfig.Save();
|
||||
ChangeTargetStorage(UnderlyingStorage.GetStorageForDirectory(default_tournament));
|
||||
@ -40,10 +40,10 @@ namespace osu.Game.Tournament.IO
|
||||
Logger.Log("Using tournament storage: " + GetFullPath(string.Empty));
|
||||
}
|
||||
|
||||
private void migrate()
|
||||
override public void Migrate(string newLocation)
|
||||
{
|
||||
var source = new DirectoryInfo(storage.GetFullPath("tournament"));
|
||||
var destination = new DirectoryInfo(GetFullPath(default_tournament));
|
||||
var destination = new DirectoryInfo(newLocation);
|
||||
|
||||
if (source.Exists)
|
||||
{
|
||||
|
@ -16,12 +16,14 @@ namespace osu.Game.IO
|
||||
{
|
||||
internal virtual string[] IGNORE_DIRECTORIES { get; }
|
||||
internal virtual string[] IGNORE_FILES { get; }
|
||||
|
||||
|
||||
protected MigratableStorage(Storage storage, string subPath = null)
|
||||
: base(storage, subPath)
|
||||
{
|
||||
}
|
||||
|
||||
abstract public void Migrate(string newLocation);
|
||||
|
||||
protected void DeleteRecursive(DirectoryInfo target, bool topLevelExcludes = true)
|
||||
{
|
||||
foreach (System.IO.FileInfo fi in target.GetFiles())
|
||||
|
@ -53,7 +53,7 @@ namespace osu.Game.IO
|
||||
Logger.Storage = UnderlyingStorage.GetStorageForDirectory("logs");
|
||||
}
|
||||
|
||||
public void Migrate(string newLocation)
|
||||
override public void Migrate(string newLocation)
|
||||
{
|
||||
var source = new DirectoryInfo(GetFullPath("."));
|
||||
var destination = new DirectoryInfo(newLocation);
|
||||
|
Reference in New Issue
Block a user