mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 03:27:25 +08:00
26 lines
941 B
C#
26 lines
941 B
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using osu.Game.Users;
|
|
|
|
namespace osu.Game.Overlays.Dashboard.Friends
|
|
{
|
|
public class FriendsOnlineStatusControl : OverlayStreamControl<FriendsBundle>
|
|
{
|
|
protected override OverlayStreamItem<FriendsBundle> CreateStreamItem(FriendsBundle value) => new FriendsOnlineStatusItem(value);
|
|
|
|
public void Populate(List<User> users)
|
|
{
|
|
Clear();
|
|
|
|
AddItem(new FriendsBundle(FriendsOnlineStatus.All, users));
|
|
AddItem(new FriendsBundle(FriendsOnlineStatus.Online, users.Where(u => u.IsOnline).ToList()));
|
|
AddItem(new FriendsBundle(FriendsOnlineStatus.Offline, users.Where(u => !u.IsOnline).ToList()));
|
|
|
|
Current.Value = Items.FirstOrDefault();
|
|
}
|
|
}
|
|
}
|