Пример #1
0
 //constructor
 public ScoreBord(ChessController controller)
 {
     InitializeComponent();
     mController = controller;
 }
Пример #2
0
 //contructor
 public BoardSquare(ChessController deController)
 {
     InitializeComponent();
     controller = deController;
 }
Пример #3
0
        //methode nieuw bord aanmaken
        public void NieuwBord(Chessboard T, ChessController deController)
        {
            controller = deController;
            //Aanmaken bord intel
            chessBoardIntel = new string[8, 8]{
            {"bT","bP","bP","bP","bP","bP","bP","bT" },
            {"bP","bP","bP","bP","bP","bP","bP","bP" },
            {"E","E","E","E","E","E","E","E" },
            {"E","E","E","E","E","E","E","E" },
            {"E","E","E","E","E","E","E","E" },
            {"E","E","E","E","E","E","E","E" },
            {"wP","wP","wP","wP","wP","wP","wP","wP" },
            {"wT","wP","wP","wP","wP","wP","wP","wT" }};
            //Aanmaken boardsquares array
            chessBoardUI = new BoardSquare[8, 8];
            //aanmaken mogelijke zetten array
            locations = new int[8, 8];
            //aanmaken boardsquares
            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    chessBoardUI[i, j] = new BoardSquare(deController);
                    chessBoardUI[i, j].Parent = T;
                    chessBoardUI[i, j].Location = new Point(j * 75 + 75, i * 75 + 75);
                    chessBoardUI[i, j].posX = j;
                    chessBoardUI[i, j].posY = i;
                    chessBoardUI[i, j].Size = new Size(75, 75);
                    //black/white
                    DrawCheckers(i, j);
                }
            }
                //SCorebord aanmaken om te tonen op het formulier
            scoreBord = new ScoreBord(deController);
            scoreBord.Parent = T;
            scoreBord.Location = new Point(675,75);

            validate();
            drawing();
        }