mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:33:30 +08:00
Merge pull request #2703 from DrabWeb/room-participants-ienumerable
Change Room.Participants to an IEnumerable
This commit is contained in:
commit
e537d8cd6b
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
@ -16,6 +17,6 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
public Bindable<GameType> Type = new Bindable<GameType>();
|
public Bindable<GameType> Type = new Bindable<GameType>();
|
||||||
public Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
|
public Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
|
||||||
public Bindable<int?> MaxParticipants = new Bindable<int?>();
|
public Bindable<int?> MaxParticipants = new Bindable<int?>();
|
||||||
public Bindable<User[]> Participants = new Bindable<User[]>();
|
public Bindable<IEnumerable<User>> Participants = new Bindable<IEnumerable<User>>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
private readonly Bindable<RoomStatus> statusBind = new Bindable<RoomStatus>();
|
private readonly Bindable<RoomStatus> statusBind = new Bindable<RoomStatus>();
|
||||||
private readonly Bindable<GameType> typeBind = new Bindable<GameType>();
|
private readonly Bindable<GameType> typeBind = new Bindable<GameType>();
|
||||||
private readonly Bindable<BeatmapInfo> beatmapBind = new Bindable<BeatmapInfo>();
|
private readonly Bindable<BeatmapInfo> beatmapBind = new Bindable<BeatmapInfo>();
|
||||||
private readonly Bindable<User[]> participantsBind = new Bindable<User[]>();
|
private readonly Bindable<IEnumerable<User>> participantsBind = new Bindable<IEnumerable<User>>();
|
||||||
|
|
||||||
public readonly Room Room;
|
public readonly Room Room;
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
@ -33,7 +34,7 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
private readonly Bindable<GameType> typeBind = new Bindable<GameType>();
|
private readonly Bindable<GameType> typeBind = new Bindable<GameType>();
|
||||||
private readonly Bindable<BeatmapInfo> beatmapBind = new Bindable<BeatmapInfo>();
|
private readonly Bindable<BeatmapInfo> beatmapBind = new Bindable<BeatmapInfo>();
|
||||||
private readonly Bindable<int?> maxParticipantsBind = new Bindable<int?>();
|
private readonly Bindable<int?> maxParticipantsBind = new Bindable<int?>();
|
||||||
private readonly Bindable<User[]> participantsBind = new Bindable<User[]>();
|
private readonly Bindable<IEnumerable<User>> participantsBind = new Bindable<IEnumerable<User>>();
|
||||||
|
|
||||||
private OsuColour colours;
|
private OsuColour colours;
|
||||||
private Box statusStrip;
|
private Box statusStrip;
|
||||||
@ -214,7 +215,7 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
|
|
||||||
participantsBind.ValueChanged += p =>
|
participantsBind.ValueChanged += p =>
|
||||||
{
|
{
|
||||||
participantCount.Count = p.Length;
|
participantCount.Count = p.Count();
|
||||||
participantInfo.Participants = p;
|
participantInfo.Participants = p;
|
||||||
participantsFlow.ChildrenEnumerable = p.Select(u => new UserTile(u));
|
participantsFlow.ChildrenEnumerable = p.Select(u => new UserTile(u));
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user