どうぶつしょうぎの完全解析をするGUI
@@ -80,6 +80,14 @@ | ||
80 | 80 | Return False |
81 | 81 | End Function |
82 | 82 | |
83 | + ''' <summary> | |
84 | + ''' なったか | |
85 | + ''' </summary> | |
86 | + ''' <value></value> | |
87 | + ''' <returns></returns> | |
88 | + ''' <remarks></remarks> | |
89 | + Public Property IsPromote As Boolean | |
90 | + | |
83 | 91 | Public Shared Operator =(ByVal op1 As Move, ByVal op2 As Move) |
84 | 92 | Return op1.ToString = op2.ToString |
85 | 93 | End Operator |
@@ -235,7 +235,12 @@ | ||
235 | 235 | _Capured(CapuredKomaIndex(capturedPiece)) -= 1 |
236 | 236 | End If |
237 | 237 | SetCells(move.ToPos, move.CapturedPiece) |
238 | - SetCells(move.FromPos, move.Koma) | |
238 | + If move.IsPromote Then | |
239 | + SetCells(move.FromPos, move.Koma - 1) 'にわとりをヒヨコに変換 | |
240 | + Else | |
241 | + SetCells(move.FromPos, move.Koma) | |
242 | + End If | |
243 | + | |
239 | 244 | End If |
240 | 245 | _side = -_side |
241 | 246 | End Sub |
@@ -253,7 +258,10 @@ | ||
253 | 258 | move.CapturedPiece = GetCells(move.ToPos) |
254 | 259 | End If |
255 | 260 | End If |
256 | - SetCells(move.ToPos, GetCells(move.FromPos)) | |
261 | + If move.Koma <> GetCells(move.FromPos) Then | |
262 | + move.IsPromote = True | |
263 | + End If | |
264 | + SetCells(move.ToPos, move.Koma) | |
257 | 265 | SetCells(move.FromPos, Koma.Empty) |
258 | 266 | End If |
259 | 267 | End Sub |