mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 00:12:59 +08:00
Remove type conversion from LoungeTab to RoomAvailability
This commit is contained in:
parent
8f1d53400e
commit
51c16867d5
@ -1,14 +1,24 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Screens.Multi;
|
||||
using osu.Game.Screens.Multi.Screens.Lounge;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCaseMultiScreen : OsuTestCase
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(Multiplayer),
|
||||
typeof(Lounge),
|
||||
typeof(FilterControl)
|
||||
};
|
||||
|
||||
public TestCaseMultiScreen()
|
||||
{
|
||||
Multiplayer multi = new Multiplayer();
|
||||
|
@ -17,11 +17,26 @@ namespace osu.Game.Screens.Multi.Screens.Lounge
|
||||
{
|
||||
DisplayStyleControl.Hide();
|
||||
}
|
||||
|
||||
public RoomAvailability Availability
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (Tabs.Current.Value)
|
||||
{
|
||||
default:
|
||||
case LoungeTab.Public:
|
||||
return RoomAvailability.Public;
|
||||
case LoungeTab.Private:
|
||||
return RoomAvailability.FriendsOnly;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum LoungeTab
|
||||
{
|
||||
Public = RoomAvailability.Public,
|
||||
Private = RoomAvailability.FriendsOnly,
|
||||
Public,
|
||||
Private,
|
||||
}
|
||||
}
|
||||
|
@ -147,8 +147,7 @@ namespace osu.Game.Screens.Multi.Screens.Lounge
|
||||
|
||||
foreach (DrawableRoom r in RoomsContainer.Children)
|
||||
{
|
||||
r.MatchingFilter = r.MatchingFilter &&
|
||||
r.Room.Availability.Value == (RoomAvailability)Filter.Tabs.Current.Value;
|
||||
r.MatchingFilter = r.MatchingFilter && r.Room.Availability.Value == Filter.Availability;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user