Move hashing functionality to ArchiveModelManager

This commit is contained in:
Dean Herbert
2018-11-28 19:16:05 +09:00
parent 0384f3549f
commit ab2b2493a1
3 changed files with 33 additions and 23 deletions

View File

@ -26,6 +26,8 @@ namespace osu.Game.Skinning
public override string[] HandledExtensions => new[] { ".osk" };
protected override string[] HashableFileTypes => new[] { ".ini" };
protected override string ImportFromStablePath => "Skins";
public SkinManager(Storage storage, DatabaseContextFactory contextFactory, IIpcHost importHost, AudioManager audio)
@ -67,9 +69,6 @@ namespace osu.Game.Skinning
/// <returns>A list of available <see cref="SkinInfo"/>.</returns>
public List<SkinInfo> GetAllUserSkins() => ModelStore.ConsumableItems.Where(s => !s.DeletePending).ToList();
protected override SkinInfo CheckForExisting(SkinInfo model)
=> ModelStore.ConsumableItems.FirstOrDefault(s => s.Name == model.Name && s.Creator == model.Creator);
protected override SkinInfo CreateModel(ArchiveReader archive) => new SkinInfo { Name = archive.Name };
protected override void Populate(SkinInfo model, ArchiveReader archive)