Пример #1
0
        /// <summary>
        /// SFEN文字列と、出力ファイル名を指定することで、局面の画像ログを出力します。
        /// </summary>
        /// <param name="sfenstring"></param>
        /// <param name="outFileFullName"></param>
        /// <param name="reportEnvironment"></param>
        /// <returns></returns>
        public static bool Write2(
            IEngineConf engineConf,
            string sfenstring,
            string outFileFullName,
            ReportEnvironment reportEnvironment
            )
        {
            bool successful = true;


            //System.Windows.Forms.MessageBox.Show(sfenstring + "\n" + outFile, "局面PNG書き出し");

            //
            // SFEN → RO_SfenStartpos
            //
            ISfenPosition2 ro_SfenStartpos;
            string         rest;

            if (!SfenStringReader.ReadString(sfenstring, out rest, out ro_SfenStartpos))
            {
                //System.Windows.Forms.MessageBox.Show(sfenstring,"sfenstringパース失敗");
                successful = false;
                goto gt_EndMethod;
            }

            KyokumenPngWriterImpl.Write1(
                engineConf,
                ro_SfenStartpos.ToKyokumen1(),
                outFileFullName,
                reportEnvironment
                );

gt_EndMethod:
            return(successful);
        }
Пример #2
0
        public static bool TryParse(
            string inputLine,
            out StartposImporter instance,
            out string rest
            )
        {
            bool successful = true;

            ISfenPosition2 ro_SfenStartpos;

            if (!SfenStringReader.ReadString(inputLine, out rest, out ro_SfenStartpos))
            {
                successful = false;
                instance   = null;
                goto gt_EndMethod;
            }

            instance = new StartposImporter(inputLine, ro_SfenStartpos);

gt_EndMethod:
            return(successful);
        }