using System;
using System.Collections.Generic;

namespace Stat.Items
{
    public class ColorDepth
    {
        /// <summary>
        /// 颜色质量
        /// </summary>
        /// <returns></returns>
        public static String[,] Get()
        {
            string[,] ColorDe = new string[8, 2];

            ColorDe[0, 0] = "-1";
            ColorDe[0, 1] = "其他";

            ColorDe[1, 0] = "6";
            ColorDe[1, 1] = "4位"; //8

            ColorDe[2, 0] = "5";
            ColorDe[2, 1] = "8位"; //8

            ColorDe[3, 0] = "1";
            ColorDe[3, 1] = "16位"; //16

            ColorDe[4, 0] = "2";
            ColorDe[4, 1] = "24位"; //24

            ColorDe[5, 0] = "3";
            ColorDe[5, 1] = "32位"; //32

            ColorDe[6, 0] = "4";
            ColorDe[6, 1] = "64位"; //64

            ColorDe[7, 0] = "7";
            ColorDe[7, 1] = "0"; //0

            return ColorDe;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        public static List<Model.StatItem> Get(List<Model.StatItem> list)
        {
            foreach (Model.StatItem item in list)
            {
                item.Name = NumberToName(item.ID);
            }
            return list;
        }

        /// <summary>
        /// 根据 编号  获取名称
        /// </summary>
        /// <param name="Eno">编号</param>
        /// <returns>名称</returns>
        private static string NumberToName(int Eno)
        {
            string[,] arr = Get();
            string ss = "其他";
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                if (arr[i, 0].ToString() == Eno.ToString())
                {
                    ss = arr[i, 1].ToString();
                }
            }
            return ss;
        }
    }
}
