using CloudGaming.DtoModel.Game;

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

using static CloudGaming.DtoModel.Epg.EpgEnum;

namespace CloudGaming.DtoModel.Epg
{
    /// <summary>
    /// Epg配置相关枚举
    /// </summary>
    public class EpgEnum
    {
        /// <summary>
        /// 常用epg分组-标识IdName
        /// </summary>
        public static class EpgCatIdName
        {
            public const string 大厅首页 = "Home";
            public const string 热门游戏 = "HotIndex";
            public const string 尊享推荐 = "HotTagIndex";


            public const string banner滚动栏 = "Banner";
            public const string 金刚位 = "HallFour";
            public const string 排行榜 = "RandIndex";
            public const string 最近推出 = "NewIndex";
            public const string 联机游戏 = "FightGame";
            public const string 一起玩 = "GameLive";
            public const string 一起看 = "VideoLive";
            public const string 游玩历史 = "MyHistory";


        }


        /// <summary>
        /// 资源图片样式，尺寸
        /// </summary>
        public enum ImageResStyle
        {


            /// <summary>
            /// 小LOGO，适用于首页最近推出、游玩历史、游戏详情页logo。
            /// </summary>
            小LOGO = 1,

            /// <summary>
            /// 中等LOGO，适用于首页体育竞技、搜索。
            /// </summary>
            中等LOGO = 2,
            /// <summary>
            /// 大LOGO，适用于首页爆款热门。
            /// </summary>
            大LOGO = 3,
            /// <summary>
            /// 竖形图，适用于首页蘑菇必玩、首页热血格斗、游戏详情页游戏推荐。
            /// </summary>
            竖形图 = 4,

            /// <summary>
            /// 游戏库，适用于游戏库。
            /// </summary>
            游戏库 = 5,

            /// <summary>
            /// 主页使用
            /// </summary>
            系类 = 6,
        }


        /// <summary>
        /// 资源类型
        /// </summary>
        public enum EpgResType
        {
            /// <summary>
            /// 没有特殊说明作用，一般用来标记下
            /// </summary>
            未定义 = 0,
            /// <summary>
            /// 对应游戏Id
            /// </summary>
            游戏 = 1,
            /// <summary>
            /// app页面
            /// </summary>
            app页面 = 2,
            /// <summary>
            /// h5
            /// </summary>
            h5 = 3,
            /// <summary>
            /// webH5
            /// </summary>
            webH5 = 4
        }

    }


    public static class EpgEnumExtend
    {

        /// <summary>
        /// 获取对应样式的图片
        /// </summary>
        /// <param name="imageResStyle"></param>
        /// <param name="gameInfo"></param>
        /// <returns></returns>
        public static int GetImageResStyle(this ImageResStyle imageResStyle, GameInfo? gameInfo)
        {
            return imageResStyle switch
            {
                var style when style == ImageResStyle.小LOGO => gameInfo?.ImageIconId,
                var style when style == ImageResStyle.中等LOGO => gameInfo?.ImageId_ShouSuo,
                var style when style == ImageResStyle.大LOGO => gameInfo?.ImageId_RM,
                var style when style == ImageResStyle.游戏库 => gameInfo?.ImageId_YXK,
                var style when style == ImageResStyle.竖形图 => gameInfo?.ImageId_TJ,
                var style when style == ImageResStyle.系类 => gameInfo?.ImageId_FK,
                _ => 0
            } ?? 0;
        }
    }
}
