• R/O
  • SSH
  • HTTPS

shoginextmove: コミット


コミットメタ情報

リビジョン57 (tree)
日時2014-09-13 22:03:06
作者bellyoshi

ログメッセージ

次の一手の編集で漢字で場所をメッセージに表示するように

変更サマリ

差分

--- ShogiNextMove/Board/Kifu/KifKifuUtil.vb (revision 56)
+++ ShogiNextMove/Board/Kifu/KifKifuUtil.vb (revision 57)
@@ -45,7 +45,45 @@
4545 "反則勝ち"}
4646 Return array
4747 End Get
48+
4849 End Property
50+
51+ Private sujiStrArray() As String = {"", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
52+ Private kanjiNumberStrArray() As String = {
53+ "", "一", "二", "三", "四", "五", "六", "七", "八", "九",
54+ "十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八"}
55+
56+ Public Function MoveToString(te As Te, prevTe As Te) As String
57+
58+ Dim text As New System.Text.StringBuilder
59+
60+ If te.IsNullMove Then
61+ Return NullMoveToString(te.NullMoveType)
62+ End If
63+
64+ If prevTe IsNot Nothing AndAlso prevTe.ToLocation.Equals(te.ToLocation) Then
65+ text.Append("同 ")
66+ Else
67+ text.Append(sujiStrArray(te.ToLocation.Col))
68+ text.Append(kanjiNumberStrArray(te.ToLocation.Row))
69+ End If
70+
71+ text.Append(KomaToName(te.Piece.Value))
72+
73+ If te.Promote Then
74+ text.Append("成")
75+ End If
76+
77+ If te.FromLocation.IsMochigoma Then
78+ text.Append("打")
79+ Else
80+ text.AppendFormat("({0}{1})", te.FromLocation.Col, te.FromLocation.Row)
81+ End If
82+
83+ Return text.ToString
84+
85+ End Function
86+
4987 End Class
5088
5189 End Namespace
--- ShogiNextMove/frmMain.vb (revision 56)
+++ ShogiNextMove/frmMain.vb (revision 57)
@@ -162,7 +162,9 @@
162162
163163 If rbEdit.Checked AndAlso rbNextMove.Checked Then
164164
165- Dim ret As DialogResult = MessageBox.Show("次の一手はこれでよいですか?", "確認", MessageBoxButtons.OKCancel)
165+ Dim msg As String = String.Format("次の一手は""{0}""でよいですか?",
166+ Board.Kifu.KifKifuUtil.GetInstance.MoveToString(e.MovingValue, Nothing))
167+ Dim ret As DialogResult = MessageBox.Show(msg, "確認", MessageBoxButtons.OKCancel)
166168 If ret = Windows.Forms.DialogResult.Cancel Then
167169 Viewer.kyokumen = _editKifu.KyokumenList(0)
168170 Viewer.DrawCurrentBitmap()
旧リポジトリブラウザで表示