Libs/CellStyleDictionary.cs

(完整代码) 980B

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace VS2048
{
    public struct CellStyle
    {
        public Color TextColor;
        public Color BackColor;

        public Font TextFont;
    }

    public class CellStyleDictionary : Dictionary<int, CellStyle>
    {
        Font _txtfont = new Font("Candara", 16, FontStyle.Bold);
        CellColorDictionary _cellColors = new CellColorDictionary();
        public CellStyleDictionary()
        {
            int factor = 2;
            CellStyle cs;

            for (int i = 0; i < 11; i++)
            {
                cs = new CellStyle();
                cs.TextColor = Color.Snow;
                cs.BackColor = _cellColors[factor];
                cs.TextFont = _txtfont;

                if ((i == 0) || (i == 1))
                    cs.TextColor = Color.DodgerBlue;
                this.Add(factor, cs);

                factor *= 2;
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。