Initial cleanup

This commit is contained in:
DrabWeb
2017-05-22 00:07:15 -03:00
parent c4e6870c12
commit e5ee7096f8
7 changed files with 307 additions and 341 deletions

View File

@ -0,0 +1,60 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Select;
using osu.Game.Screens.Multiplayer;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using osu.Framework.Testing;
using osu.Game.Online.Multiplayer;
using osu.Game.Users;
using osu.Game.Database;
namespace osu.Desktop.VisualTests.Tests
{
class TestCaseDrawableMultiplayerRoom : TestCase
{
public override string Description => @"Select your favourite room";
public override void Reset()
{
base.Reset();
DrawableMultiplayerRoom p;
Add(new FillFlowContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.Y,
Width = 500f,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
p = new DrawableMultiplayerRoom(new MultiplayerRoom
{
Name = @"Great Room Right Here",
Host = new User { Username = @"Naeferith", Country = new Country { FlagName = @"FR" }},
Status = MultiplayerRoomStatus.Open,
CurrentBeatmap = new BeatmapMetadata { Title = @"Seiryu", Artist = @"Critical Crystal" },
}),
new DrawableMultiplayerRoom(new MultiplayerRoom
{
Name = @"Relax It's The Weekend",
Host = new User{ Username = @"Someone", Country = new Country { FlagName = @"CA" }},
Status = MultiplayerRoomStatus.Playing,
CurrentBeatmap = new BeatmapMetadata { Title = @"ZAQ", Artist = @"Serendipity" },
}),
}
});
AddStep(@"change state", () => { p.Room.Status = MultiplayerRoomStatus.Playing; });
}
}
}

View File

@ -1,70 +0,0 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Select;
using osu.Game.Screens.Multiplayer;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using osu.Framework.Testing;
namespace osu.Desktop.VisualTests.Tests
{
class TestCaseMultiRoomPanel : TestCase
{
private MultiRoomPanel test;
private FillFlowContainer panelContainer;
public override string Description => @"Select your favourite room";
private void action(int action)
{
switch (action)
{
case 0:
test.State = test.State == MultiRoomPanel.PanelState.Free ? MultiRoomPanel.PanelState.Busy : MultiRoomPanel.PanelState.Free;
break;
}
}
public override void Reset()
{
base.Reset();
AddStep(@"ChangeState", () => action(0));
Add(panelContainer = new FillFlowContainer //Positionning container
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Direction = FillDirection.Vertical,
Size = new Vector2(0.4f, 0.5f),
Children = new Drawable[]
{
test = new MultiRoomPanel("Great Room Right Here", "Naeferith", 0),
new MultiRoomPanel("Relax it's the weekend", "Someone", 1),
}
});
}
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{
foreach (MultiRoomPanel panel in panelContainer.Children)
{
panel.BorderThickness = 0;
if (panel.Clicked == true)
{
panel.BorderThickness = 3;
panel.Clicked = false;
}
}
return base.OnMouseUp(state, args);
}
}
}

View File

@ -220,7 +220,7 @@
<Compile Include="Tests\TestCaseLeaderboard.cs" />
<Compile Include="Beatmaps\TestWorkingBeatmap.cs" />
<Compile Include="Tests\TestCaseBeatmapDetailArea.cs" />
<Compile Include="Tests\TestCaseMultiRoomPanel.cs" />
<Compile Include="Tests\TestCaseDrawableMultiplayerRoom.cs" />
</ItemGroup>
<ItemGroup />
<ItemGroup />