• R/O
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javaandroidc++linuxc#objective-ccocoa誰得qtrubybathyscaphegamephpguicwindows翻訳pythonomegattwitterframeworkbtronarduinovb.net計画中(planning stage)directxpreviewertestゲームエンジンdom

どうぶつしょうぎの完全解析をするGUI


コミットメタ情報

リビジョン30 (tree)
日時2015-07-22 17:24:25
作者bellyoshi

ログメッセージ

変更サマリ

差分

--- doubutu.UI.Form/Board.vb (revision 29)
+++ doubutu.UI.Form/Board.vb (revision 30)
@@ -188,10 +188,10 @@
188188 ElseIf _logs.Count > _turnCount Then
189189 If _logs(_turnCount) <> move Then
190190 _logs(_turnCount) = move
191+ For i As Integer = _logs.Count - 1 To _turnCount + 1 Step -1
192+ _logs.RemoveAt(i)
193+ Next
191194 End If
192- For i As Integer = _logs.Count - 1 To _turnCount + 1 Step -1
193- _logs.RemoveAt(i)
194- Next
195195 End If
196196 _turnCount += 1
197197 Debug.Assert(_turnCount <= _logs.Count)
@@ -198,11 +198,30 @@
198198 End Sub
199199
200200 ''' <summary>
201+ ''' 元に戻せるか
202+ ''' </summary>
203+ ''' <returns></returns>
204+ ''' <remarks></remarks>
205+ Public Function CanUndo() As Boolean
206+ Return 0 < _turnCount
207+ End Function
208+
209+ ''' <summary>
210+ ''' 初手に戻す
211+ ''' </summary>
212+ ''' <remarks></remarks>
213+ Public Sub UndoAll()
214+ While CanUndo()
215+ Undo()
216+ End While
217+ End Sub
218+
219+ ''' <summary>
201220 ''' 一手戻す。
202221 ''' </summary>
203222 ''' <remarks></remarks>
204223 Public Sub Undo()
205- If _turnCount <= 0 Then
224+ If Not CanUndo() Then
206225 Exit Sub
207226 End If
208227 _turnCount -= 1
--- doubutu.UI.Form/frmMain.vb (revision 29)
+++ doubutu.UI.Form/frmMain.vb (revision 30)
@@ -40,7 +40,7 @@
4040 End Sub
4141
4242 Private Sub btnUndoFirst_Click(sender As System.Object, e As System.EventArgs) Handles btnUndoFirst.Click
43- BoardViewer1.kyokumen = New Board()
43+ BoardViewer1.kyokumen.UndoAll()
4444 BoardViewer1.DrawCurrentBitmap()
4545 End Sub
4646
@@ -85,6 +85,8 @@
8585 BoardViewer1.kyokumen.DoMove(move)
8686 BoardViewer1.DrawCurrentBitmap()
8787 BackgroundWorker1.RunWorkerAsync()
88+ output = String.Empty
89+ TextBox1.Text = String.Empty
8890 End If
8991 End Sub
9092 End Class