예제 #1
0
        private void InstantiateMatch(Player playerWhite, Player playerBlack)
        {
            Gamemode     gamemode = CreateGamemode(gamemodeType, playerWhite, playerBlack);
            BoardDisplay board    = new BoardDisplay(gamemode, white == PlayerType.Local, black == PlayerType.Local || black == PlayerType.LichessPlayer);

            board.Show();
        }
예제 #2
0
        private void InstantiatePieceButtons(List <Piece> pieces)
        {
            tableLayoutPanel.ColumnCount = pieces.Count;
            tableLayoutPanel.ColumnStyles.Clear();
            int i;

            for (i = 0; i < pieces.Count; i++)
            {
                // set size to any percent, doesnt matter
                tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1));
            }

            foreach (var piece in pieces)
            {
                PictureBox control = new PictureBox
                {
                    Image       = BoardDisplay.GetPieceImage(piece),
                    SizeMode    = PictureBoxSizeMode.Zoom,
                    BorderStyle = BorderStyle.FixedSingle,
                    Width       = 200,
                    Height      = 200
                };
                control.Click += Control_Click;

                PieceButtons[control.Image] = piece;
                tableLayoutPanel.Controls.Add(control);
            }
        }