1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 18:32:56 +08:00

Renamespace

This commit is contained in:
smoogipoo 2018-12-10 19:20:41 +09:00
parent cd41c45686
commit 1ac615b490
28 changed files with 77 additions and 73 deletions

View File

@ -9,7 +9,7 @@ using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer;
using osu.Game.Rulesets;
using osu.Game.Screens.Multi.Components;
using osu.Game.Screens.Multi.Lounge.Components;
using osu.Game.Users;
namespace osu.Game.Tests.Visual

View File

@ -10,8 +10,8 @@ using osu.Game.Online.Multiplayer;
using osu.Game.Rulesets;
using osu.Game.Screens;
using osu.Game.Screens.Backgrounds;
using osu.Game.Screens.Multi.Components;
using osu.Game.Screens.Multi.Screens.Lounge;
using osu.Game.Screens.Multi.Lounge;
using osu.Game.Screens.Multi.Lounge.Components;
using osu.Game.Users;
using osuTK.Input;
@ -20,12 +20,12 @@ namespace osu.Game.Tests.Visual
[TestFixture]
public class TestCaseLounge : ManualInputManagerTestCase
{
private TestLounge lounge;
private TestLoungeScreen loungeScreen;
[BackgroundDependencyLoader]
private void load(RulesetStore rulesets)
{
lounge = new TestLounge();
loungeScreen = new TestLoungeScreen();
Room[] rooms =
{
@ -159,47 +159,47 @@ namespace osu.Game.Tests.Visual
},
};
AddStep(@"show", () => Add(lounge));
AddStep(@"set rooms", () => lounge.Rooms = rooms);
AddStep(@"show", () => Add(loungeScreen));
AddStep(@"set rooms", () => loungeScreen.Rooms = rooms);
selectAssert(0);
AddStep(@"clear rooms", () => lounge.Rooms = new Room[] {});
AddAssert(@"no room selected", () => lounge.SelectedRoom == null);
AddStep(@"set rooms", () => lounge.Rooms = rooms);
AddStep(@"clear rooms", () => loungeScreen.Rooms = new Room[] {});
AddAssert(@"no room selected", () => loungeScreen.SelectedRoom == null);
AddStep(@"set rooms", () => loungeScreen.Rooms = rooms);
selectAssert(1);
AddStep(@"open room 1", () => clickRoom(1));
AddUntilStep(() => lounge.ChildScreen?.IsCurrentScreen == true, "wait until room current");
AddStep(@"make lounge current", lounge.MakeCurrent);
AddUntilStep(() => loungeScreen.ChildScreen?.IsCurrentScreen == true, "wait until room current");
AddStep(@"make lounge current", loungeScreen.MakeCurrent);
filterAssert(@"THE FINAL", LoungeTab.Public, 1);
filterAssert(string.Empty, LoungeTab.Public, 2);
filterAssert(string.Empty, LoungeTab.Private, 1);
filterAssert(string.Empty, LoungeTab.Public, 2);
filterAssert(@"no matches", LoungeTab.Public, 0);
AddStep(@"clear rooms", () => lounge.Rooms = new Room[] {});
AddStep(@"set rooms", () => lounge.Rooms = rooms);
AddAssert(@"no matches after clear", () => !lounge.ChildRooms.Any());
AddStep(@"clear rooms", () => loungeScreen.Rooms = new Room[] {});
AddStep(@"set rooms", () => loungeScreen.Rooms = rooms);
AddAssert(@"no matches after clear", () => !loungeScreen.ChildRooms.Any());
filterAssert(string.Empty, LoungeTab.Public, 2);
AddStep(@"exit", lounge.Exit);
AddStep(@"exit", loungeScreen.Exit);
}
private void clickRoom(int n)
{
InputManager.MoveMouseTo(lounge.ChildRooms.ElementAt(n));
InputManager.MoveMouseTo(loungeScreen.ChildRooms.ElementAt(n));
InputManager.Click(MouseButton.Left);
}
private void selectAssert(int n)
{
AddStep($@"select room {n}", () => clickRoom(n));
AddAssert($@"room {n} selected", () => lounge.SelectedRoom == lounge.ChildRooms.ElementAt(n).Room);
AddAssert($@"room {n} selected", () => loungeScreen.SelectedRoom == loungeScreen.ChildRooms.ElementAt(n).Room);
}
private void filterAssert(string filter, LoungeTab tab, int endCount)
{
AddStep($@"filter '{filter}', {tab}", () => lounge.SetFilter(filter, tab));
AddAssert(@"filtered correctly", () => lounge.ChildRooms.Count() == endCount);
AddStep($@"filter '{filter}', {tab}", () => loungeScreen.SetFilter(filter, tab));
AddAssert(@"filtered correctly", () => loungeScreen.ChildRooms.Count() == endCount);
}
private class TestLounge : Lounge
private class TestLoungeScreen : LoungeScreen
{
protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault();

View File

@ -8,8 +8,8 @@ using osu.Framework.Allocation;
using osu.Game.Beatmaps;
using osu.Game.Online.Multiplayer;
using osu.Game.Rulesets;
using osu.Game.Screens.Multi.Components;
using osu.Game.Screens.Multi.Screens.Match;
using osu.Game.Screens.Multi.Match;
using osu.Game.Screens.Multi.Match.Components;
using osu.Game.Users;
namespace osu.Game.Tests.Visual
@ -96,9 +96,9 @@ namespace osu.Game.Tests.Visual
},
};
Match match = new Match(room);
MatchScreen matchScreen = new MatchScreen(room);
AddStep(@"show", () => Add(match));
AddStep(@"show", () => Add(matchScreen));
AddStep(@"null beatmap", () => room.Beatmap.Value = null);
AddStep(@"change name", () => room.Name.Value = @"Two Awesome Rooms");
AddStep(@"change status", () => room.Status.Value = new RoomStatusPlaying());
@ -146,7 +146,7 @@ namespace osu.Game.Tests.Visual
},
});
AddStep(@"exit", match.Exit);
AddStep(@"exit", matchScreen.Exit);
}
}
}

View File

@ -6,7 +6,7 @@ using osu.Framework.Allocation;
using osu.Game.Beatmaps;
using osu.Game.Online.Multiplayer;
using osu.Game.Rulesets;
using osu.Game.Screens.Multi.Screens.Match;
using osu.Game.Screens.Multi.Match.Components;
namespace osu.Game.Tests.Visual
{

View File

@ -3,7 +3,7 @@
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Screens.Multi.Screens.Match;
using osu.Game.Screens.Multi.Match.Components;
using osu.Game.Users;
namespace osu.Game.Tests.Visual

View File

@ -4,7 +4,7 @@
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Screens.Multi;
using osu.Game.Screens.Multi.Screens.Lounge;
using osu.Game.Screens.Multi.Lounge;
namespace osu.Game.Tests.Visual
{
@ -13,14 +13,14 @@ namespace osu.Game.Tests.Visual
{
public TestCaseMultiHeader()
{
Lounge lounge;
LoungeScreen loungeScreen;
Children = new Drawable[]
{
lounge = new Lounge
loungeScreen = new LoungeScreen
{
Padding = new MarginPadding { Top = Header.HEIGHT },
},
new Header(lounge),
new Header(loungeScreen),
};
}
}

View File

@ -5,7 +5,8 @@ using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Game.Screens.Multi;
using osu.Game.Screens.Multi.Screens.Lounge;
using osu.Game.Screens.Multi.Lounge;
using osu.Game.Screens.Multi.Lounge.Components;
namespace osu.Game.Tests.Visual
{
@ -15,7 +16,7 @@ namespace osu.Game.Tests.Visual
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(Multiplayer),
typeof(Lounge),
typeof(LoungeScreen),
typeof(FilterControl)
};

View File

@ -7,7 +7,7 @@ using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Online.Multiplayer;
using osu.Game.Rulesets;
using osu.Game.Screens.Multi.Components;
using osu.Game.Screens.Multi.Lounge.Components;
using osu.Game.Users;
namespace osu.Game.Tests.Visual

View File

@ -8,8 +8,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing.Input;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Components;
using osu.Game.Screens.Multi.Screens.Match;
using osu.Game.Screens.Multi.Match.Components;
using osuTK.Input;
namespace osu.Game.Tests.Visual

View File

@ -10,7 +10,6 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.SearchableList;
using osu.Game.Screens.Multi.Screens;
using osuTK;
using osuTK.Graphics;

View File

@ -1,7 +1,7 @@
// 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.Screens.Multi.Screens
namespace osu.Game.Screens.Multi
{
public interface IMultiplayerScreen
{

View File

@ -17,11 +17,12 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Components;
using osu.Game.Users;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Components
namespace osu.Game.Screens.Multi.Lounge.Components
{
public class DrawableRoom : OsuClickableContainer, IStateful<SelectionState>, IFilterable
{

View File

@ -6,7 +6,7 @@ using osu.Game.Online.Multiplayer;
using osu.Game.Overlays.SearchableList;
using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Screens.Lounge
namespace osu.Game.Screens.Multi.Lounge.Components
{
public class FilterControl : SearchableListFilterControl<LoungeTab, LoungeTab>
{

View File

@ -13,7 +13,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Users;
using osuTK;
namespace osu.Game.Screens.Multi.Components
namespace osu.Game.Screens.Multi.Lounge.Components
{
public class ParticipantInfo : Container
{

View File

@ -17,11 +17,12 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Components;
using osu.Game.Users;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Components
namespace osu.Game.Screens.Multi.Lounge.Components
{
public class RoomInspector : Container
{

View File

@ -11,12 +11,13 @@ using osu.Framework.Screens;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer;
using osu.Game.Overlays.SearchableList;
using osu.Game.Screens.Multi.Components;
using osu.Game.Screens.Multi.Lounge.Components;
using osu.Game.Screens.Multi.Match;
using osuTK;
namespace osu.Game.Screens.Multi.Screens.Lounge
namespace osu.Game.Screens.Multi.Lounge
{
public class Lounge : MultiplayerScreen
public class LoungeScreen : MultiplayerScreen
{
private readonly Container content;
private readonly SearchContainer search;
@ -32,7 +33,7 @@ namespace osu.Game.Screens.Multi.Screens.Lounge
protected override Drawable TransitionContent => content;
public Lounge()
public LoungeScreen()
{
Children = new Drawable[]
{
@ -164,7 +165,7 @@ namespace osu.Game.Screens.Multi.Screens.Lounge
Filter.Tabs.Current.Value = LoungeTab.Public;
Push(new Match.Match(roomBeingCreated));
Push(new MatchScreen(roomBeingCreated));
}
search.SearchTerm = Filter.Search.Current.Value ?? string.Empty;
@ -194,7 +195,7 @@ namespace osu.Game.Screens.Multi.Screens.Lounge
RoomsContainer.ForEach(c => c.State = c == room ? SelectionState.Selected : SelectionState.NotSelected);
Inspector.Room = room.Room;
Push(new Match.Match(room.Room));
Push(new MatchScreen(room.Room));
}
private class RoomsFilterContainer : FillFlowContainer<DrawableRoom>, IHasFilterableChildren

View File

@ -9,9 +9,10 @@ using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Components;
using osuTK;
namespace osu.Game.Screens.Multi.Components
namespace osu.Game.Screens.Multi.Match.Components
{
public class GameTypePicker : DisableableTabControl<GameType>
{

View File

@ -17,7 +17,7 @@ using osu.Game.Online.Multiplayer;
using osu.Game.Overlays.SearchableList;
using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Screens.Match
namespace osu.Game.Screens.Multi.Match.Components
{
public class Header : Container
{

View File

@ -17,7 +17,7 @@ using osu.Game.Overlays.SearchableList;
using osu.Game.Screens.Multi.Components;
using osuTK;
namespace osu.Game.Screens.Multi.Screens.Match
namespace osu.Game.Screens.Multi.Match.Components
{
public class Info : Container
{

View File

@ -3,7 +3,7 @@
using osu.Framework.Configuration;
namespace osu.Game.Screens.Multi.Screens.Match
namespace osu.Game.Screens.Multi.Match.Components
{
public abstract class MatchPage
{

View File

@ -10,7 +10,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer;
using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Screens.Match
namespace osu.Game.Screens.Multi.Match.Components
{
public class MatchTabControl : PageTabControl<MatchPage>
{

View File

@ -11,7 +11,7 @@ using osu.Game.Screens.Multi.Components;
using osu.Game.Users;
using osuTK;
namespace osu.Game.Screens.Multi.Screens.Match
namespace osu.Game.Screens.Multi.Match.Components
{
public class Participants : CompositeDrawable
{

View File

@ -10,10 +10,11 @@ using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Components;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Components
namespace osu.Game.Screens.Multi.Match.Components
{
public class RoomAvailabilityPicker : DisableableTabControl<RoomAvailability>
{

View File

@ -12,11 +12,10 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer;
using osu.Game.Overlays.SearchableList;
using osu.Game.Screens.Multi.Components;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Screens.Multi.Screens.Match
namespace osu.Game.Screens.Multi.Match.Components
{
public class RoomSettingsOverlay : FocusedOverlayContainer
{

View File

@ -9,12 +9,13 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.Game.Online.API;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Match.Components;
using osu.Game.Screens.Select;
using osu.Game.Users;
namespace osu.Game.Screens.Multi.Screens.Match
namespace osu.Game.Screens.Multi.Match
{
public class Match : MultiplayerScreen
public class MatchScreen : MultiplayerScreen
{
private readonly Participants participants;
@ -41,7 +42,7 @@ namespace osu.Game.Screens.Multi.Screens.Match
[Resolved]
private APIAccess api { get; set; }
public Match(Room room)
public MatchScreen(Room room)
{
this.room = room;
@ -53,29 +54,29 @@ namespace osu.Game.Screens.Multi.Screens.Match
participantsBind.BindTo(room.Participants);
maxParticipantsBind.BindTo(room.MaxParticipants);
Header header;
Components.Header header;
RoomSettingsOverlay settings;
Info info;
Children = new Drawable[]
{
header = new Header
header = new Components.Header
{
Depth = -1,
},
info = new Info
{
Margin = new MarginPadding { Top = Header.HEIGHT },
Margin = new MarginPadding { Top = Components.Header.HEIGHT },
},
participants = new Participants
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = Header.HEIGHT + Info.HEIGHT },
Padding = new MarginPadding { Top = Components.Header.HEIGHT + Info.HEIGHT },
},
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = Header.HEIGHT },
Padding = new MarginPadding { Top = Components.Header.HEIGHT },
Child = settings = new RoomSettingsOverlay
{
RelativeSizeAxes = Axes.Both,

View File

@ -9,7 +9,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Containers;
using osu.Game.Screens.Menu;
using osu.Game.Screens.Multi.Screens.Lounge;
using osu.Game.Screens.Multi.Lounge;
namespace osu.Game.Screens.Multi
{
@ -26,7 +26,7 @@ namespace osu.Game.Screens.Multi
RelativeSizeAxes = Axes.Both,
};
Lounge lounge;
LoungeScreen loungeScreen;
Children = new Drawable[]
{
new Container
@ -53,12 +53,12 @@ namespace osu.Game.Screens.Multi
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = Header.HEIGHT },
Child = lounge = new Lounge(),
Child = loungeScreen = new LoungeScreen(),
},
new Header(lounge),
new Header(loungeScreen),
};
lounge.Exited += s => Exit();
loungeScreen.Exited += s => Exit();
}
protected override void OnEntering(Screen last)

View File

@ -5,7 +5,7 @@ using osu.Framework.Graphics;
using osu.Framework.Screens;
using osu.Game.Graphics.Containers;
namespace osu.Game.Screens.Multi.Screens
namespace osu.Game.Screens.Multi
{
public abstract class MultiplayerScreen : OsuScreen, IMultiplayerScreen
{

View File

@ -1,7 +1,7 @@
// 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.Game.Screens.Multi.Screens;
using osu.Game.Screens.Multi;
namespace osu.Game.Screens.Select
{