⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chess.cs

📁 5子棋 有小BUG
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
/**
 * Title: 棋子
 * author 赵睿
 * version:5子棋抽象设计版本3.0
 * time 2007-11-17
 */
namespace CheongSam
{
    class Chess
    {   
        public static int Step = 0;
        Size size; //棋子的大小
        Font chessFont = new Font("宋体", 8, FontStyle.Bold);//棋子的标记字体
        Graphics grap;
        MainUI UI;

        public Chess(MainUI UI)
        {
            this.UI = UI;
            size = new Size(20, 20);
        }

        public void DrawChess(int m, int n, bool isBlackWhite)
        {
            Brush brush = isBlackWhite ? Brushes.Black : Brushes.White;
            using(this.grap = this.UI.CreateGraphics())
            {
                grap.FillEllipse(brush, m * 25 + 10,n * 25 + 5,size.Width,size.Height);
                //grap.DrawString("" + (++Step), chessFont, Brushes.Red,
                //    new PointF(m * 25, n * 25));
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -