Esempio n. 1
0
        /// <summary>
        /// 変換「各(自駒が動ける升)」→「各(自駒が動ける手)」
        /// </summary>
        /// <param name="komaBETUSusumeruMasus"></param>
        /// <returns></returns>
        public static Maps_OneAndMulti <Finger, ShootingStarlightable> KomaBETUSusumeruMasusToKomaBETUAllMoves(
            List_OneAndMulti <Finger, SySet <SyElement> > komaBETUSusumeruMasus,
            Node <ShootingStarlightable, KyokumenWrapper> siteiNode_genzai
            )
        {
            Maps_OneAndMulti <Finger, ShootingStarlightable> komabetuAllMove = new Maps_OneAndMulti <Finger, ShootingStarlightable>();

            komaBETUSusumeruMasus.Foreach_Entry((Finger figKoma, SySet <SyElement> susumuMasuSet, ref bool toBreak) =>
            {
                RO_Star_Koma srcKoma = Util_Koma.AsKoma(siteiNode_genzai.Value.ToKyokumenConst.StarlightIndexOf(figKoma).Now);

                foreach (SyElement susumuMasu in susumuMasuSet.Elements)
                {
                    // 移動先の駒
                    RO_Star_Koma dstKoma = new RO_Star_Koma(
                        srcKoma.Pside,
                        Masu_Honshogi.Items_All[Util_Masu.AsMasuNumber(susumuMasu)],
                        srcKoma.Haiyaku//TODO:ここで、駒の種類が「成り」に上書きされているバージョンも考えたい
                        );

                    ShootingStarlightable move = new RO_ShootingStarlight(
                        //figKoma,//駒
                        srcKoma,       // 移動元
                        dstKoma,       // 移動先
                        PieceType.None //取った駒不明
                        );
                    komabetuAllMove.AddOverwrite(figKoma, move);

                    // これが通称【水際のいんちきプログラム】なんだぜ☆
                    // 必要により、【成り】の指し手を追加します。
                    Converter04.AddKomaBETUAllNariMoves(
                        komabetuAllMove,
                        figKoma,
                        srcKoma,
                        dstKoma
                        );
                }
            });

            //Converter04.AssertNariMove(komabetuAllMove, "#KomabetuMasus_ToKomabetuAllMove");//ここはOK

            return(komabetuAllMove);
        }
Esempio n. 2
0
        /// <summary>
        /// 指し手一覧を、駒毎に分けます。
        /// </summary>
        /// <param name="hubNode">指し手一覧</param>
        /// <param name="logTag"></param>
        /// <returns>駒毎の、全指し手</returns>
        public Maps_OneAndMulti <Finger, ShootingStarlightable> SplitMoveByKoma(Node <ShootingStarlightable, KyokumenWrapper> hubNode)
        {
            SkyConst src_Sky = this.Value.ToKyokumenConst;


            Maps_OneAndMulti <Finger, ShootingStarlightable> enable_teMap = new Maps_OneAndMulti <Finger, ShootingStarlightable>();


            hubNode.Foreach_NextNodes((string key, Node <ShootingStarlightable, KyokumenWrapper> nextNode, ref bool toBreak) =>
            {
                ShootingStarlightable nextMove = nextNode.Key;

                Finger figKoma = Util_Sky.Fingers_AtMasuNow(src_Sky, Util_Koma.AsKoma(nextMove.LongTimeAgo).Masu).ToFirst();

                enable_teMap.AddOverwrite(figKoma, nextMove);
            });

            return(enable_teMap);
        }