• R/O
  • SSH
  • HTTPS

コミット

タグ
未設定

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

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

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


コミットメタ情報

リビジョン27 (tree)
日時2015-07-22 13:38:11
作者bellyoshi

ログメッセージ

変更サマリ

差分

--- doubutu.UI.Form/frmMain.Designer.vb (revision 26)
+++ doubutu.UI.Form/frmMain.Designer.vb (revision 27)
@@ -27,8 +27,10 @@
2727 Me.TextBox1 = New System.Windows.Forms.TextBox()
2828 Me.btnUndoFirst = New System.Windows.Forms.Button()
2929 Me.btnUndo = New System.Windows.Forms.Button()
30+ Me.btnNext = New System.Windows.Forms.Button()
31+ Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker()
3032 Me.BoardViewer1 = New doubutu.UI.Form.Control.Board.BoardViewer()
31- Me.btnNext = New System.Windows.Forms.Button()
33+ Me.chkRotated = New System.Windows.Forms.CheckBox()
3234 Me.SuspendLayout()
3335 '
3436 'btnAnalyze
@@ -42,11 +44,11 @@
4244 '
4345 'TextBox1
4446 '
45- Me.TextBox1.Location = New System.Drawing.Point(805, 62)
47+ Me.TextBox1.Location = New System.Drawing.Point(805, 41)
4648 Me.TextBox1.Multiline = True
4749 Me.TextBox1.Name = "TextBox1"
4850 Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
49- Me.TextBox1.Size = New System.Drawing.Size(392, 318)
51+ Me.TextBox1.Size = New System.Drawing.Size(392, 595)
5052 Me.TextBox1.TabIndex = 2
5153 '
5254 'btnUndoFirst
@@ -67,6 +69,18 @@
6769 Me.btnUndo.Text = "一手戻す"
6870 Me.btnUndo.UseVisualStyleBackColor = True
6971 '
72+ 'btnNext
73+ '
74+ Me.btnNext.Location = New System.Drawing.Point(262, 35)
75+ Me.btnNext.Name = "btnNext"
76+ Me.btnNext.Size = New System.Drawing.Size(75, 23)
77+ Me.btnNext.TabIndex = 5
78+ Me.btnNext.Text = "一手進める"
79+ Me.btnNext.UseVisualStyleBackColor = True
80+ '
81+ 'BackgroundWorker1
82+ '
83+ '
7084 'BoardViewer1
7185 '
7286 Me.BoardViewer1.IsBoardViewRotated = False
@@ -76,14 +90,15 @@
7690 Me.BoardViewer1.Size = New System.Drawing.Size(774, 544)
7791 Me.BoardViewer1.TabIndex = 3
7892 '
79- 'btnNext
93+ 'chkRotated
8094 '
81- Me.btnNext.Location = New System.Drawing.Point(262, 35)
82- Me.btnNext.Name = "btnNext"
83- Me.btnNext.Size = New System.Drawing.Size(75, 23)
84- Me.btnNext.TabIndex = 5
85- Me.btnNext.Text = "一手進める"
86- Me.btnNext.UseVisualStyleBackColor = True
95+ Me.chkRotated.AutoSize = True
96+ Me.chkRotated.Location = New System.Drawing.Point(528, 59)
97+ Me.chkRotated.Name = "chkRotated"
98+ Me.chkRotated.Size = New System.Drawing.Size(59, 19)
99+ Me.chkRotated.TabIndex = 6
100+ Me.chkRotated.Text = "反転"
101+ Me.chkRotated.UseVisualStyleBackColor = True
87102 '
88103 'frmMain
89104 '
@@ -90,6 +105,7 @@
90105 Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!)
91106 Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
92107 Me.ClientSize = New System.Drawing.Size(1272, 672)
108+ Me.Controls.Add(Me.chkRotated)
93109 Me.Controls.Add(Me.btnNext)
94110 Me.Controls.Add(Me.btnUndo)
95111 Me.Controls.Add(Me.btnUndoFirst)
@@ -108,5 +124,7 @@
108124 Friend WithEvents btnUndoFirst As System.Windows.Forms.Button
109125 Friend WithEvents btnUndo As System.Windows.Forms.Button
110126 Friend WithEvents btnNext As System.Windows.Forms.Button
127+ Friend WithEvents BackgroundWorker1 As System.ComponentModel.BackgroundWorker
128+ Friend WithEvents chkRotated As System.Windows.Forms.CheckBox
111129
112130 End Class
--- doubutu.UI.Form/frmMain.vb (revision 26)
+++ doubutu.UI.Form/frmMain.vb (revision 27)
@@ -1,7 +1,12 @@
11 Public Class frmMain
2+ Dim output As String
23
4+ Private Sub btnAnalyze_Click(sender As System.Object, e As System.EventArgs) Handles btnAnalyze.Click
5+ Analyze()
36
4- Private Sub btnAnalyze_Click(sender As System.Object, e As System.EventArgs) Handles btnAnalyze.Click
7+ End Sub
8+
9+ Private Sub Analyze()
510 Dim board As Board = BoardViewer1.kyokumen
611 Const checkStateDir As String = "C:\Users\watanabe\Desktop\souce\doubutu\Debug"
712 Const checkStateName As String = "doubutu.checkState.exe"
@@ -19,9 +24,8 @@
1924
2025 Dim p As System.Diagnostics.Process = _
2126 System.Diagnostics.Process.Start(psInfo)
22- Dim output As String = p.StandardError.ReadToEnd()
27+ output = p.StandardError.ReadToEnd()
2328 output = output.Replace(vbCr + vbCrLf, vbLf)
24- TextBox1.Text = output
2529
2630 End Sub
2731
@@ -49,4 +53,21 @@
4953 BoardViewer1.kyokumen.DoNext()
5054 BoardViewer1.DrawCurrentBitmap()
5155 End Sub
56+
57+ Private Sub BoardViewer1_Edited(sender As System.Object, e As doubutu.UI.Form.Control.Board.EditedEventArgs) Handles BoardViewer1.Edited
58+ BackgroundWorker1.RunWorkerAsync()
59+ End Sub
60+
61+ Private Sub BackgroundWorker1_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
62+ Analyze()
63+ End Sub
64+
65+ Private Sub BackgroundWorker1_RunWorkerCompleted(sender As System.Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
66+ TextBox1.Text = output
67+ End Sub
68+
69+ Private Sub chkRotated_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles chkRotated.CheckedChanged
70+ BoardViewer1.IsBoardViewRotated = chkRotated.Checked
71+ BoardViewer1.DrawCurrentBitmap()
72+ End Sub
5273 End Class
--- doubutu.UI.Form/Control/Board/BoardViewer.vb (revision 26)
+++ doubutu.UI.Form/Control/Board/BoardViewer.vb (revision 27)
@@ -9,8 +9,8 @@
99
1010 Private imageLoader As ImageLoader = imageLoader.GetInstance
1111
12- Dim goteMochigoma() As Koma = {Koma.GoteHI, Koma.GoteZO, Koma.GoteKI}
13- Dim SenteMochigoma() As Koma = {Koma.SenteHI, Koma.SenteZO, Koma.SenteKI}
12+ Dim _goteMochigoma() As Koma = {Koma.GoteHI, Koma.GoteZO, Koma.GoteKI}
13+ Dim _senteMochigoma() As Koma = {Koma.SenteHI, Koma.SenteZO, Koma.SenteKI}
1414
1515 Private _kyokumen As New doubutu.UI.Form.Board
1616 Public Property kyokumen As doubutu.UI.Form.Board
@@ -87,17 +87,17 @@
8787
8888
8989 '持ち駒を表示する。
90- For i As Integer = 0 To SenteMochigoma.Count - 1
91- Dim KomaCount As Integer = kyokumen.CapturedKomaCount(SenteMochigoma(i))
90+ For i As Integer = 0 To _senteMochigoma.Count - 1
91+ Dim KomaCount As Integer = kyokumen.CapturedKomaCount(_senteMochigoma(i))
9292 If KomaCount > 0 Then
93- DrawMochigoma(graphics, SenteMochigoma(i), KomaCount)
93+ DrawMochigoma(graphics, _senteMochigoma(i), KomaCount)
9494 End If
9595 Next
9696
97- For i As Integer = 0 To goteMochigoma.Count - 1
98- Dim KomaCount As Integer = kyokumen.CapturedKomaCount(goteMochigoma(i))
97+ For i As Integer = 0 To _goteMochigoma.Count - 1
98+ Dim KomaCount As Integer = kyokumen.CapturedKomaCount(_goteMochigoma(i))
9999 If KomaCount > 0 Then
100- DrawMochigoma(graphics, goteMochigoma(i), KomaCount)
100+ DrawMochigoma(graphics, _goteMochigoma(i), KomaCount)
101101 End If
102102 Next
103103
@@ -183,15 +183,15 @@
183183 Dim isGote As Boolean = KomaUtil.IsGote(komaValue)
184184 Dim idx As Integer = -1
185185 If isGote Then
186- For i As Integer = 0 To goteMochigoma.Count - 1
187- If goteMochigoma(i) = komaValue Then
186+ For i As Integer = 0 To _goteMochigoma.Count - 1
187+ If _goteMochigoma(i) = komaValue Then
188188 idx = i
189189 Exit For
190190 End If
191191 Next
192192 Else
193- For i As Integer = 0 To SenteMochigoma.Count - 1
194- If SenteMochigoma(i) = komaValue Then
193+ For i As Integer = 0 To _senteMochigoma.Count - 1
194+ If _senteMochigoma(i) = komaValue Then
195195 idx = i
196196 Exit For
197197 End If
@@ -502,7 +502,7 @@
502502 Debug.Assert(1 <= dan AndAlso dan <= 3)
503503 End If
504504 End If
505- Return dan + Koma.Sente
505+ Return _senteMochigoma(dan - 1)
506506 End Function
507507
508508 Public Function GetGoteKomadaiKomaValue(mousePt As Point) As Koma
@@ -511,7 +511,7 @@
511511 dan = CByte((mousePt.Y - (Me.goteKomadaiRect.Top + 11)) \ Me.komaSize.Height + 1)
512512 Debug.Assert(1 <= dan AndAlso dan <= 3)
513513 End If
514- Return dan + Koma.Gote
514+ Return _goteMochigoma(dan - 1)
515515 End Function
516516
517517