Exemplo n.º 1
0
        /// <summary>
        /// ノード全体を文字列化します。
        /// </summary>
        private void MakeString(StringBuilder sb, int nmoves)
        {
            if (Move != null)
            {
                var str    = Move.ToString();
                var hanlen = str.HankakuLength();

                sb.AppendFormat(" - {0}{1}",
                                str, new string(' ', Math.Max(0, 14 - hanlen)));
            }

            if (NextNode != null)
            {
                NextNode.MakeString(sb, nmoves + 1);
            }

            for (var i = 1; i < NextNodes.Count(); ++i)
            {
                sb.AppendLine();
                sb.Append(new string(' ', 17 * nmoves));

                NextNodes[i].MakeString(sb, nmoves);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// ノード全体を文字列化します。
        /// </summary>
        private void MakeString(StringBuilder sb, int nmoves)
        {
            if (LiteralMove != null)
            {
                var str    = LiteralMove.ToString();
                var hanlen = str.HankakuLength();

                sb.AppendFormat(" - {0}{1}",
                                str, new string(' ', 8 - hanlen));
            }

            if (NextNode != null)
            {
                NextNode.MakeString(sb, nmoves + 1);
            }

            if (VariationNode != null)
            {
                sb.AppendLine();
                sb.Append(new string(' ', 11 * nmoves));

                VariationNode.MakeString(sb, nmoves);
            }
        }