Eabei.GoBangGame/Eabei.Controls/Chessboard.cs

(开头部分) 16KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using Eabei.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


/********************************
*  命名空间: Eabei.Controls
*  
*  功    能: N/A
*  类    名: Chessboard
*  
*  作    者: EB(Eabei)
*  创建日期: 2022/6/28 13:01:13
*********************************/

namespace Eabei.Controls
{
    public class Chessboard : Control
    {
        public Chessboard()
        {
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.UserPaint, true);

            //this.BackColor = Color.FromArgb(0xff, 0xcc, 0x85, 0x2a);
            this.BackColor = Color.Transparent;
        }




        private List<ChessPointInfo> boardPoints = new();
        private List<ChessPointInfo> drawPoints = new();
        private ChessPointInfo? currChessPoint = null;
        [DefaultValue(typeof(Color), "0x57, 0x3f, 0x20"), Description("格子边线的颜色")]
        private Color _lineColor = Color.FromArgb(0xff, 0x57, 0x3f, 0x20);

        public Color LineColor { get => _lineColor; set { _lineColor = value; this.Invalidate(false); } }

        private ChessCardCamp _camp;
        [DefaultValue(typeof(ChessCardCamp), "None"), Description("表示是黑棋还是白棋"), Browsable(false)]
        public ChessCardCamp Camp { get => _camp; set => _camp = value; }

        private string _gameOverString = "游戏结束";
        [DefaultValue("游戏结束"), Description("游戏结束显示的文本")]
        public string GameOverString { get => _gameOverString; set { _gameOverString = value; this.Invalidate(false); } }

        private bool _gameOverEnabled;
        [DefaultValue(false), Description("游戏结束显示的显示标志")]
        public bool GameOverEnabled { get => _gameOverEnabled; set { _gameOverEnabled = value; this.Invalidate(false); } }

        private bool _isAllowAddChessInfo = true;
        [DefaultValue(true), Description("是否允许鼠标按下添加棋子")]
后面还有 336 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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