Move stable_config declaration, rename testscene

This commit is contained in:
Shivam 2020-05-28 15:28:27 +02:00
parent 6e8a964c45
commit 3731e76b10
5 changed files with 6 additions and 7 deletions

View File

@ -39,7 +39,8 @@ namespace osu.Game.Tournament.IPC
[Resolved]
private StableInfo stableInfo { get; set; }
private const string STABLE_CONFIG = "tournament/stable.json";
public const string STABLE_CONFIG = "tournament/stable.json";
public Storage IPCStorage { get; private set; }
@ -166,6 +167,7 @@ namespace osu.Game.Tournament.IPC
return stableInfo.StablePath.Value;
string stableInstallPath = string.Empty;
try
{
List<Func<string>> stableFindMethods = new List<Func<string>>
@ -195,7 +197,6 @@ namespace osu.Game.Tournament.IPC
}
}
private void saveStableConfig(string path)
{
stableInfo.StablePath.Value = path;

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using Newtonsoft.Json;
using osu.Framework.Bindables;
namespace osu.Game.Tournament.Models
@ -14,6 +13,5 @@ namespace osu.Game.Tournament.Models
public class StableInfo
{
public Bindable<string> StablePath = new Bindable<string>(string.Empty);
}
}

View File

@ -38,7 +38,7 @@ namespace osu.Game.Tournament.Screens
[BackgroundDependencyLoader(true)]
private void load(Storage storage, OsuColour colours)
{
var initialPath = new DirectoryInfo(storage.GetFullPath(stableInfo.StablePath.Value ?? string.Empty)).Parent?.FullName;
var initialPath = new DirectoryInfo(storage.GetFullPath(stableInfo.StablePath.Value ?? string.Empty)).Parent?.FullName;
AddRangeInternal(new Drawable[]
{

View File

@ -148,9 +148,9 @@ namespace osu.Game.Tournament
if (stableInfo == null)
stableInfo = new StableInfo();
if (storage.Exists(StableInfo.STABLE_CONFIG))
if (storage.Exists(FileBasedIPC.STABLE_CONFIG))
{
using (Stream stream = storage.GetStream(StableInfo.STABLE_CONFIG, FileAccess.Read, FileMode.Open))
using (Stream stream = storage.GetStream(FileBasedIPC.STABLE_CONFIG, FileAccess.Read, FileMode.Open))
using (var sr = new StreamReader(stream))
{
stableInfo = JsonConvert.DeserializeObject<StableInfo>(sr.ReadToEnd());