-
Notifications
You must be signed in to change notification settings - Fork 0
/
Piece.cs
104 lines (92 loc) · 2.27 KB
/
Piece.cs
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace WpfApplication2
{
public enum PieceType
{
King, Queen, Rook, Knight, Bishop, Pawn
}
public enum PlayerColor
{
White,
Black
}
// ToDo?: Compare setter values to previous value for PropertyChanged
public class Piece : INotifyPropertyChanged
{
private PlayerColor playerColorValue;
private PieceType pieceTypeValue;
private byte xValue;
private byte yValue;
public Piece(PlayerColor playerColor, PieceType pieceType, byte x, byte y)
{
playerColorValue = playerColor;
pieceTypeValue = pieceType;
xValue = x;
yValue = y;
}
//public static clas
public static void a ()
{
}
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
public PlayerColor playerColor
{
get
{
return playerColorValue;
}
}
public PieceType pieceType
{
get
{
return pieceTypeValue;
}
set
{
pieceTypeValue = value;
NotifyPropertyChanged();
}
}
public byte x
{
get
{
return xValue;
}
set
{
xValue = value;
NotifyPropertyChanged();
}
}
public byte y
{
get
{
return yValue;
}
set
{
yValue = value;
NotifyPropertyChanged();
}
}
public int GamestateId { get; set; }
public int PieceId { get; set; }
public string Name { get; set; }
}
}