using CloudGaming.DtoModel.Account.User;
using CloudGaming.DtoModel.PlayGame;

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CloudGaming.DtoModel.Other;

/// <summary>
/// app监控数据
/// </summary>
public class AppMonitorInfo : AppBasicStatistics
{
    /// <summary>
    /// 用户所有的游戏状态
    /// </summary>
    public List<PlayGameUserInfo> PlayGameUserInfos { get; set; }

    /// <summary>
    /// 在线人数
    /// </summary>
    public List<UserInfoCache> OnlineUser { get; set; }

    /// <summary>
    /// 用户游戏状态统计
    /// </summary>
    public Dictionary<PlayGameStatus, int> PlayGameStatusStatistics() => PlayGameUserInfos == null ? new Dictionary<PlayGameStatus, int>() : PlayGameUserInfos.GroupBy(it => it.GameStatus).ToDictionary(it => it.Key, it => it.Count());

}
