1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Reorder class

This commit is contained in:
Dean Herbert 2019-07-30 21:53:28 +09:00
parent de20d02672
commit 6ded53b3a9

View File

@ -16,30 +16,15 @@ namespace osu.Game.Rulesets.Osu.Tests
{
public abstract class SkinnableTestScene : OsuGridTestScene
{
private static Skin getSkinFromResources(SkinManager skins, string name)
{
using (var storage = new DllResourceStore("osu.Game.Rulesets.Osu.Tests.dll"))
{
var tempName = Path.GetTempFileName();
File.Delete(tempName);
Directory.CreateDirectory(tempName);
var files = storage.GetAvailableResources().Where(f => f.StartsWith($"Resources/{name}"));
foreach (var file in files)
using (var stream = storage.GetStream(file))
using (var newFile = File.Create(Path.Combine(tempName, Path.GetFileName(file))))
stream.CopyTo(newFile);
return skins.GetSkin(skins.Import(tempName).Result);
}
}
private Skin metricsSkin;
private Skin defaultSkin;
private Skin specialSkin;
protected SkinnableTestScene()
: base(2, 2)
{
}
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{
@ -58,9 +43,24 @@ namespace osu.Game.Rulesets.Osu.Tests
Cell(3).Child = new LocalSkinOverrideContainer(specialSkin) { RelativeSizeAxes = Axes.Both }.WithChild(creationFunction());
}
protected SkinnableTestScene()
: base(2, 2)
private static Skin getSkinFromResources(SkinManager skins, string name)
{
using (var storage = new DllResourceStore("osu.Game.Rulesets.Osu.Tests.dll"))
{
var tempName = Path.GetTempFileName();
File.Delete(tempName);
Directory.CreateDirectory(tempName);
var files = storage.GetAvailableResources().Where(f => f.StartsWith($"Resources/{name}"));
foreach (var file in files)
using (var stream = storage.GetStream(file))
using (var newFile = File.Create(Path.Combine(tempName, Path.GetFileName(file))))
stream.CopyTo(newFile);
return skins.GetSkin(skins.Import(tempName).Result);
}
}
}
}