Chess/frmMain.cs

(开头部分) 1KB

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

using GameComponent;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Chess
{
    public partial class frmMain : Form
    {
        private GameBoard board;

        public frmMain()
        {
            InitializeComponent();
            setGameBoard();
            
        }

        private void setGameBoard()
        {
            board = new GameBoard();
            board.OnGameEnd += board_OnGameEnd;
            this.Controls.Add(board);
            Rectangle rec = this.ClientRectangle;
            int xPos = (rec.Width - board.Width) / 2;
            int yPos = (rec.Height - menu.Height - board.Height) / 2 + menu.Height;
            board.Left = xPos;
            board.Top = yPos;
        }

        private void board_OnGameEnd(object sender, GameComponent.GameEndEventArgs e)
        {
            MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK);
        }

        private void menuItemNewGame_Click(object sender, EventArgs e)
        {
            board.ReStartGame();
        }

        private void menuItemDebug_Click(object sender, EventArgs e)
        {
            frmDubug frm = new frmDubug(this.board);
            frm.Show();
        }

        private void menuItemExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void menuItemAbout_Click(object sender, EventArgs e)
        {
            MessageBox.Show("五子棋小游戏");
        }
后面还有 7 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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