Пример #1
0
        public void SetThemes(BoardTheme board, PieceTheme piece)
        {
            BoardImages = board;
            PieceImages = piece;

            chessBoardPanel.Refresh();
        }
Пример #2
0
        public ThemeSelectionForm(ThemeDatabase db, BoardTheme currentBoardTheme, PieceTheme currentPieceTheme)
        {
            InitializeComponent();

            Icon = Properties.Resources.application_icon;

            Themes             = db;
            SelectedBoardTheme = currentBoardTheme;
            SelectedPieceTheme = currentPieceTheme;

            chessBoard.SetThemes(SelectedBoardTheme, SelectedPieceTheme);

            confirmButton.DialogResult = DialogResult.OK;
            cancelButton.DialogResult  = DialogResult.Cancel;

            foreach (var kv in Themes.BoardThemes)
            {
                boardThemesListBox.Items.Add(kv.Key);
            }

            foreach (var kv in Themes.PieceThemes)
            {
                pieceThemesListBox.Items.Add(kv.Key);
            }

            boardThemesListBox.SelectedItem = SelectedBoardTheme.Name;
            pieceThemesListBox.SelectedItem = SelectedPieceTheme.Name;
        }
Пример #3
0
        public PromotionSelectionForm(PieceTheme theme, Player player)
        {
            InitializeComponent();

            Icon = Properties.Resources.application_icon;

            PieceImages = theme;
            SideToMove  = player;

            knightPromotionButton.Image = PieceImages.GetImageForPiece(new Knight(player));
            bishopPromotionButton.Image = PieceImages.GetImageForPiece(new Bishop(player));
            rookPromotionButton.Image   = PieceImages.GetImageForPiece(new Rook(player));
            queenPromotionButton.Image  = PieceImages.GetImageForPiece(new Queen(player));

            knightPromotionButton.DialogResult = DialogResult.OK;
            bishopPromotionButton.DialogResult = DialogResult.OK;
            rookPromotionButton.DialogResult   = DialogResult.OK;
            queenPromotionButton.DialogResult  = DialogResult.OK;
        }
Пример #4
0
 private void PieceThemesListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     SelectedPieceTheme = Themes.PieceThemes[(string)pieceThemesListBox.SelectedItem];
     chessBoard.SetThemes(SelectedBoardTheme, SelectedPieceTheme);
 }