| @@ -17,8 +17,10 @@ | ||
| 17 | 17 | { |
| 18 | 18 | return _isTypeOf[pieceType]; |
| 19 | 19 | } |
| 20 | + | |
| 21 | + ///なりごま | |
| 22 | + public bool IsPromoted { get; set; } = false; | |
| 20 | 23 | |
| 21 | - const int Promoted = 0; //なりごま | |
| 22 | 24 | const int Pawn = 1;// 歩 |
| 23 | 25 | const int Lance = 2;// 香車 |
| 24 | 26 | const int Knight = 3;// 桂馬 |
| @@ -27,10 +29,22 @@ | ||
| 27 | 29 | const int Bishop = 6;// 角 |
| 28 | 30 | const int Rook = 7;// 飛 |
| 29 | 31 | const int King = 8;// 王 |
| 30 | - const int Black = 9;// 現在先手の駒 | |
| 31 | - const int White = 10;// 現在後手の駒 | |
| 32 | - //const long Wall = Black | White;//壁 | |
| 33 | 32 | |
| 33 | + // 現在先手の駒 | |
| 34 | + public bool IsBlack { get; set; } | |
| 35 | + // 現在後手の駒 | |
| 36 | + public bool IsWhite { get; set; } | |
| 37 | + //壁 | |
| 38 | + public bool IsWall { | |
| 39 | + get { | |
| 40 | + return IsBlack && IsWhite; | |
| 41 | + } | |
| 42 | + set { | |
| 43 | + /// IsBlack = true; | |
| 44 | + /// IsWhite = true; | |
| 45 | + } | |
| 46 | + } | |
| 47 | + | |
| 34 | 48 | public static int MaxOfType() |
| 35 | 49 | { |
| 36 | 50 | return King; |
| @@ -49,6 +63,16 @@ | ||
| 49 | 63 | _isTypeOf[Black] = false; |
| 50 | 64 | _isTypeOf[White] = false; |
| 51 | 65 | _isTypeOf[color] = true; |
| 66 | + IsEmtpy = false; | |
| 52 | 67 | } |
| 68 | + | |
| 69 | + public Piece GetEmpty() | |
| 70 | + { | |
| 71 | + return Piece() | |
| 72 | + } | |
| 73 | + | |
| 74 | + | |
| 75 | + public bool IsEmtpy { get; set; } | |
| 76 | + | |
| 53 | 77 | } |
| 54 | 78 | } |
| @@ -7,8 +7,8 @@ | ||
| 7 | 7 | { |
| 8 | 8 | class Board |
| 9 | 9 | { |
| 10 | - const int SIZE_OF_X = 9; | |
| 11 | - const int SIZE_OF_Y = 9; | |
| 10 | + const int SIZE_OF_X = 9 + 2; | |
| 11 | + const int SIZE_OF_Y = 9 + 2; | |
| 12 | 12 | private Piece[] _cells; |
| 13 | 13 | public Piece GetCells(int x,int y) |
| 14 | 14 | { |