Esempio n. 1
0
        /// <summary>
        /// 棋譜ツリーのカレントを変更します。
        /// </summary>
        /// <param name="isMakimodosi"></param>
        /// <param name="ittemodosuReference"></param>
        /// <param name="logTag"></param>
        public static void Before2(
            ref IttemodosuResult ittemodosuReference
            )
        {
            Node <IMove, KyokumenWrapper> editNodeRef = ittemodosuReference.SyuryoNode_OrNull;
            IMove nextMove = editNodeRef.Key;

            if (ittemodosuReference.FoodKomaSyurui != PieceType.None)
            {
                // 元のキーの、取った駒の種類だけを差替えます。
                nextMove = Util_Sky258A.BuildMove(editNodeRef.Key.LongTimeAgo, editNodeRef.Key.Now, ittemodosuReference.FoodKomaSyurui);

                // 現手番
                Playerside genTebanside = ((KifuNode)editNodeRef).Value.KyokumenConst.KaisiPside;

                // キーを差替えたノード
                editNodeRef = new KifuNodeImpl(nextMove, new KyokumenWrapper(ittemodosuReference.Susunda_Sky_orNull));//, genTebanside
            }


            string nextMoveStr = ConvMoveStrSfen.ToMoveStrSfen(nextMove);



            ittemodosuReference.SyuryoNode_OrNull = editNodeRef;// この変数を返すのがポイント。棋譜とは別に、現局面。


            //Util_IttesasuRoutine.iIttemodosuAfter3_ChangeCurrent(kifu_mutable);
        }
Esempio n. 2
0
        //Dictionary<Starbeamable, KyokumenWrapper>
        public static Dictionary <string, SasuEntry> KomabetuMasusToMoveBetuSky(
            List_OneAndMulti <Finger, SySet <SyElement> > sMs, SkyConst src_Sky)
        {
            Dictionary <string, SasuEntry> moveBetuEntry = new Dictionary <string, SasuEntry>();


            sMs.Foreach_Entry((Finger key, SySet <SyElement> value, ref bool toBreak) =>
            {
                RO_Star koma = Util_Starlightable.AsKoma(src_Sky.StarlightIndexOf(key).Now);


                foreach (SyElement dstMasu in value.Elements)
                {
                    IMove move = Util_Sky258A.BuildMove(
                        new RO_Star(src_Sky.KaisiPside, koma.Masu, koma.Haiyaku),
                        new RO_Star(src_Sky.KaisiPside, dstMasu, koma.Haiyaku),//FIXME:配役は適当。
                        PieceType.None
                        );

                    string moveStr      = ConvMoveStrSfen.ToMoveStrSfen(move);//重複防止用のキー
                    SasuEntry sasuEntry = new SasuEntry(
                        move,
                        key,     //動かす駒
                        dstMasu, //移動先升
                        false    //成りません。
                        );
                    if (!moveBetuEntry.ContainsKey(moveStr))
                    {
                        moveBetuEntry.Add(moveStr, sasuEntry);
                    }
                }
            });

            return(moveBetuEntry);

            /*
             * Dictionary<Starbeamable, KyokumenWrapper> result = new Dictionary<Starbeamable, KyokumenWrapper>();
             * foreach (KeyValuePair<string, SasuEntry> entry in movebetuEntry)
             * {
             *  result.Add(
             *      entry.Value.NewMove,
             *      new KyokumenWrapper(Util_Sasu341.Sasu(
             *      src_Sky,//指定局面
             *      entry.Value.Finger,//動かす駒
             *      entry.Value.Masu,//移動先升
             *      entry.Value.Naru,//成りません。
             *      logTag
             *  )));
             * }
             *
             * return result;
             */
        }
Esempio n. 3
0
        public static Dictionary <string, SasuEntry> ToMoveBetuSky1(
            Maps_OneAndOne <Finger, SySet <SyElement> > komabetuSusumuMasus,
            SkyConst src_Sky
            )
        {
            Dictionary <string, SasuEntry> result_komabetuEntry = new Dictionary <string, SasuEntry>();

            komabetuSusumuMasus.Foreach_Entry((Finger key, SySet <SyElement> value, ref bool toBreak) =>
            {
                RO_Star koma = Util_Starlightable.AsKoma(src_Sky.StarlightIndexOf(key).Now);


                foreach (SyElement dstMasu in value.Elements)
                {
                    IMove move = Util_Sky258A.BuildMove(
                        //key,
                        new RO_Star(src_Sky.KaisiPside, koma.Masu, koma.Haiyaku),
                        new RO_Star(src_Sky.KaisiPside, dstMasu, koma.Haiyaku),//FIXME:配役は適当。
                        PieceType.None
                        );

                    string moveStr = ConvMoveStrSfen.ToMoveStrSfen(move);//重複防止用のキー

                    if (!result_komabetuEntry.ContainsKey(moveStr))
                    {
                        result_komabetuEntry.Add(
                            moveStr,
                            new SasuEntry(
                                move,
                                key,     //動かす駒
                                dstMasu, //移動先升
                                false    //成りません
                                )
                            );
                    }
                }
            });

            return(result_komabetuEntry);
        }