-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm2.cs
More file actions
45 lines (39 loc) · 1.14 KB
/
Form2.cs
File metadata and controls
45 lines (39 loc) · 1.14 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
43
44
45
using System;
using System.Windows.Forms;
using static Chess.Chess;
namespace Chess
{
public partial class Form2 : Form
{
public Figure Figure = Figure.Null;
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Figure = !Turn ? Figure.WhiteQueen : Figure.BlackQueen;
Close();
}
private void button2_Click(object sender, EventArgs e)
{
Figure = !Turn ? Figure.WhiteKnight : Figure.BlackKnight;
Close();
}
private void button3_Click(object sender, EventArgs e)
{
Figure = !Turn ? Figure.WhiteBishop : Figure.BlackBishop;
Close();
}
private void button4_Click(object sender, EventArgs e)
{
Figure = !Turn ? Figure.WhiteRook : Figure.BlackRook;
Close();
}
private void Form2_FormClosing(object sender, FormClosingEventArgs e)
{
if (Figure != Figure.Null) return;
Figure = !Turn ? Figure.WhiteQueen : Figure.BlackQueen;
}
}
}