static void Main()
        {
            EwnController mainController = new EwnController();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm(mainController));
        }
 public ChessBoardView(EwnController controller, int height, int width)
 {
     this.Height    = height;
     this.Width     = width;
     mainController = controller;
     chessBoardHash = new ChessOwner[CHESS_BOARD_SIZE, CHESS_BOARD_SIZE];
     InitializeComponent();
 }
Beispiel #3
0
 public Minimax(EwnController controller)
 {
     mainController = controller;
     chessBoard     = new ChessOwner[ChessBoardView.CHESS_BOARD_SIZE, ChessBoardView.CHESS_BOARD_SIZE];
     for (int i = 0; i < ChessBoardView.CHESS_BOARD_SIZE; i++)
     {
         for (int j = 0; j < ChessBoardView.CHESS_BOARD_SIZE; j++)
         {
             // 从 chessBoardView 中拷贝当前棋盘状态
             chessBoard[i, j] = controller.chessBoardView.chessBoardHash[i, j];
         }
     }
 }
Beispiel #4
0
 public MainForm(EwnController controller)
 {
     InitializeComponent();
     mainController = controller;
     chessBoardView = new ChessBoardView(controller, chessPanel.Height, chessPanel.Width);
     mainController.chessBoardView = chessBoardView;
     mainController.diceLabel      = diceLabel;
     diceLabel.Text = mainController.moveChessNum.ToString();
     mainController.player1Label = playerLabel1;
     mainController.player2Label = playerLabel2;
     chessPanel.Controls.Add(chessBoardView);
     chessBoardView.SetPlayer1(mainController.player1);
     chessBoardView.SetPlayer2(mainController.player2);
 }