mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
MultiplayerRoom -> Room
This commit is contained in:
80
osu.Desktop.VisualTests/Tests/TestCaseDrawableRoom.cs
Normal file
80
osu.Desktop.VisualTests/Tests/TestCaseDrawableRoom.cs
Normal file
@ -0,0 +1,80 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Screens.Multiplayer;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Database;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
internal class TestCaseDrawableRoom : TestCase
|
||||
{
|
||||
public override string Description => @"Select your favourite room";
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
DrawableRoom p;
|
||||
Add(new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Width = 500f,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
p = new DrawableRoom(new Room
|
||||
{
|
||||
Name = @"Great Room Right Here",
|
||||
Host = new User { Username = @"Naeferith", Id = 9492835, Country = new Country { FlagName = @"FR" }},
|
||||
Status = MultiplayerRoomStatus.Open,
|
||||
CurrentBeatmap = new BeatmapMetadata { Title = @"Seiryu", Artist = @"Critical Crystal" },
|
||||
}),
|
||||
new DrawableRoom(new Room
|
||||
{
|
||||
Name = @"Relax It's The Weekend",
|
||||
Host = new User{ Username = @"peppy", Id = 2, Country = new Country { FlagName = @"AU" }},
|
||||
Status = MultiplayerRoomStatus.Playing,
|
||||
CurrentBeatmap = new BeatmapMetadata { Title = @"ZAQ", Artist = @"Serendipity" },
|
||||
}),
|
||||
}
|
||||
});
|
||||
|
||||
AddStep(@"change state", () =>
|
||||
{
|
||||
p.Room.Value.Status = MultiplayerRoomStatus.Playing;
|
||||
p.Room.TriggerChange();
|
||||
});
|
||||
|
||||
AddStep(@"change name", () =>
|
||||
{
|
||||
p.Room.Value.Name = @"I Changed Name";
|
||||
p.Room.TriggerChange();
|
||||
});
|
||||
|
||||
AddStep(@"change host", () =>
|
||||
{
|
||||
p.Room.Value.Host = new User { Username = @"DrabWeb", Id = 6946022, Country = new Country { FlagName = @"CA" } };
|
||||
p.Room.TriggerChange();
|
||||
});
|
||||
|
||||
AddStep(@"change beatmap", () =>
|
||||
{
|
||||
p.Room.Value.CurrentBeatmap = null;
|
||||
p.Room.TriggerChange();
|
||||
});
|
||||
|
||||
AddStep(@"change state", () =>
|
||||
{
|
||||
p.Room.Value.Status = MultiplayerRoomStatus.Open;
|
||||
p.Room.TriggerChange();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user