2023-06-23 00:37:25 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-03-04 12:24:19 +08:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-11-15 20:28:42 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
2020-01-09 12:43:44 +08:00
|
|
|
|
using osu.Framework.Utils;
|
2018-11-15 20:28:42 +08:00
|
|
|
|
using osu.Game.Tournament.IPC;
|
|
|
|
|
using osu.Game.Tournament.Screens.Gameplay.Components;
|
|
|
|
|
|
2019-06-18 14:28:36 +08:00
|
|
|
|
namespace osu.Game.Tournament.Tests.Components
|
2018-11-15 20:28:42 +08:00
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class TestSceneMatchScoreDisplay : TournamentTestScene
|
2018-11-15 20:28:42 +08:00
|
|
|
|
{
|
|
|
|
|
[Cached(Type = typeof(MatchIPCInfo))]
|
|
|
|
|
private MatchIPCInfo matchInfo = new MatchIPCInfo();
|
|
|
|
|
|
2019-06-14 16:25:07 +08:00
|
|
|
|
public TestSceneMatchScoreDisplay()
|
2018-11-15 20:28:42 +08:00
|
|
|
|
{
|
2021-08-05 16:53:38 +08:00
|
|
|
|
Add(new TournamentMatchScoreDisplay
|
2018-11-15 20:28:42 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
|
|
Scheduler.AddDelayed(() =>
|
|
|
|
|
{
|
|
|
|
|
int amount = (int)((RNG.NextDouble() - 0.5) * 10000);
|
|
|
|
|
if (amount < 0)
|
|
|
|
|
matchInfo.Score1.Value -= amount;
|
|
|
|
|
else
|
|
|
|
|
matchInfo.Score2.Value += amount;
|
|
|
|
|
}, 100, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|