-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPromotePawnForm.cs
More file actions
executable file
·42 lines (39 loc) · 1.41 KB
/
PromotePawnForm.cs
File metadata and controls
executable file
·42 lines (39 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using Chess;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ChessAI_Bck
{
public partial class PromotePawnForm : Form
{
public PromotionType SelectedPromotion { get; private set; }
public PromotePawnForm(PieceColor side)
{
InitializeComponent();
if (side == PieceColor.White)
{
QueenButton.ImageKey = "WQueen";
KnightButton.ImageKey = "WKnight";
RookButton.ImageKey = "WRook";
BishopButton.ImageKey = "WBishop";
}
else
{
QueenButton.ImageKey = "BQueen";
KnightButton.ImageKey = "BKnight";
RookButton.ImageKey = "BRook";
BishopButton.ImageKey = "BBishop";
}
QueenButton.Click += (s, e) => { SelectedPromotion = PromotionType.ToQueen; Close(); };
KnightButton.Click += (s, e) => { SelectedPromotion = PromotionType.ToKnight; Close(); };
RookButton.Click += (s, e) => { SelectedPromotion = PromotionType.ToRook; Close(); };
BishopButton.Click += (s, e) => { SelectedPromotion = PromotionType.ToBishop; Close(); };
}
}
}