mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Add score display
This commit is contained in:
@ -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)
|
||||
|
19
osu.Game.Tournament/IPC/MatchIPCInfo.cs
Normal file
19
osu.Game.Tournament/IPC/MatchIPCInfo.cs
Normal 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();
|
||||
}
|
||||
}
|
14
osu.Game.Tournament/IPC/TourneyState.cs
Normal file
14
osu.Game.Tournament/IPC/TourneyState.cs
Normal 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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user