Add score display

This commit is contained in:
Dean Herbert
2018-11-15 21:28:42 +09:00
parent 54b87e9c93
commit 46e163ec5e
10 changed files with 277 additions and 38 deletions

View File

@ -4,8 +4,6 @@
using System;
using System.IO;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Logging;
using osu.Framework.Platform.Windows;
using osu.Game.Beatmaps;
@ -16,16 +14,7 @@ using osu.Game.Rulesets;
namespace osu.Game.Tournament.IPC
{
public enum TourneyState
{
Initialising,
Idle,
WaitingForClients,
Playing,
Ranking
}
public class FileBasedIPC : Component
public class FileBasedIPC : MatchIPCInfo
{
[Resolved]
protected APIAccess API { get; private set; }
@ -33,15 +22,7 @@ namespace osu.Game.Tournament.IPC
[Resolved]
protected RulesetStore Rulesets { get; private set; }
public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
public readonly Bindable<LegacyMods> Mods = new Bindable<LegacyMods>();
public readonly Bindable<TourneyState> State = new Bindable<TourneyState>();
private int lastBeatmapId;
public int Score1;
public int Score2;
[BackgroundDependencyLoader]
private void load()
@ -97,8 +78,8 @@ namespace osu.Game.Tournament.IPC
using (var stream = stable.GetStream(file_ipc_scores_filename))
using (var sr = new StreamReader(stream))
{
Score1 = int.Parse(sr.ReadLine());
Score2 = int.Parse(sr.ReadLine());
Score1.Value = int.Parse(sr.ReadLine());
Score2.Value = int.Parse(sr.ReadLine());
}
}
catch (Exception)

View File

@ -0,0 +1,19 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Legacy;
namespace osu.Game.Tournament.IPC
{
public class MatchIPCInfo : Component
{
public Bindable<BeatmapInfo> Beatmap { get; } = new Bindable<BeatmapInfo>();
public Bindable<LegacyMods> Mods { get; } = new Bindable<LegacyMods>();
public Bindable<TourneyState> State { get; } = new Bindable<TourneyState>();
public BindableInt Score1 { get; } = new BindableInt();
public BindableInt Score2 { get; } = new BindableInt();
}
}

View File

@ -0,0 +1,14 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Tournament.IPC
{
public enum TourneyState
{
Initialising,
Idle,
WaitingForClients,
Playing,
Ranking
}
}