Пример #1
0
 /// <summary>
 /// FIXME:使ってない?
 /// </summary>
 /// <param name="masuNumber"></param>
 /// <param name="koma"></param>
 public void AddKoma(int masuNumber, RO_Star koma)
 {
     if (Conv_MasuHandle.OnShogiban(masuNumber))
     {
         this.ban81.Add(masuNumber, koma);
     }
     else if (Conv_MasuHandle.OnSenteKomadai(masuNumber))
     {
         if (this.motiBlack.ContainsKey(koma.Komasyurui))
         {
             this.motiBlack[koma.Komasyurui] = this.motiBlack[koma.Komasyurui];
         }
         else
         {
             this.motiBlack.Add(koma.Komasyurui, 0);
         }
     }
     else if (Conv_MasuHandle.OnGoteKomadai(masuNumber))
     {
         if (this.motiWhite.ContainsKey(koma.Komasyurui))
         {
             this.motiWhite[koma.Komasyurui] = this.motiWhite[koma.Komasyurui];
         }
         else
         {
             this.motiWhite.Add(koma.Komasyurui, 0);
         }
     }
 }
Пример #2
0
        private void AddKoma(SyElement masu, RO_Star koma)// Ks14 komaSyurui
        {
            Debug.Assert(!this.BanObject201.ContainsKey(Conv_SyElement.ToMasuNumber(masu)), $"既に駒がある枡に、駒を置こうとしています。[{Conv_SyElement.ToMasuNumber(masu)}]");


            this.BanObject201.Add(Conv_SyElement.ToMasuNumber(masu), koma);

            if (Conv_MasuHandle.OnShogiban(Conv_SyElement.ToMasuNumber(masu)))
            {
                // 盤上

                // 特にカウントはなし
            }
            else if (Conv_MasuHandle.OnSenteKomadai(Conv_SyElement.ToMasuNumber(masu)))
            {
                // 先手駒台
                switch (koma.Komasyurui)
                {
                case PieceType.P:
                    this.moti1P++;
                    break;

                case PieceType.L:
                    this.moti1L++;
                    break;

                case PieceType.N:
                    this.moti1N++;
                    break;

                case PieceType.S:
                    this.moti1S++;
                    break;

                case PieceType.G:
                    this.moti1G++;
                    break;

                case PieceType.K:
                    this.moti1K++;
                    break;

                case PieceType.R:
                    this.moti1R++;
                    break;

                case PieceType.B:
                    this.moti1B++;
                    break;
                }
            }
            else if (Conv_MasuHandle.OnGoteKomadai(Conv_SyElement.ToMasuNumber(masu)))
            {
                // 後手駒台
                switch (koma.Komasyurui)
                {
                case PieceType.P:
                    this.moti2p++;
                    break;

                case PieceType.L:
                    this.moti2l++;
                    break;

                case PieceType.N:
                    this.moti2n++;
                    break;

                case PieceType.S:
                    this.moti2s++;
                    break;

                case PieceType.G:
                    this.moti2g++;
                    break;

                case PieceType.K:
                    this.moti2k++;
                    break;

                case PieceType.R:
                    this.moti2r++;
                    break;

                case PieceType.B:
                    this.moti2b++;
                    break;
                }
            }
            else
            {
                // 駒袋
                switch (koma.Komasyurui)
                {
                case PieceType.P:
                    this.fukuroP++;
                    break;

                case PieceType.L:
                    this.fukuroL++;
                    break;

                case PieceType.N:
                    this.fukuroN++;
                    break;

                case PieceType.S:
                    this.fukuroS++;
                    break;

                case PieceType.G:
                    this.fukuroG++;
                    break;

                case PieceType.K:
                    this.fukuroK++;
                    break;

                case PieceType.R:
                    this.fukuroR++;
                    break;

                case PieceType.B:
                    this.fukuroB++;
                    break;
                }
            }
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="syurui"></param>
        /// <param name="masu_shogiban">0~80</param>
        /// <returns></returns>
        public static Komahaiyaku185 ToHaiyaku(PieceType syurui, SyElement masu_shogiban, Playerside pside)
        {
            Komahaiyaku185 result;

            int masuHandle = Conv_SyElement.ToMasuNumber(Util_Masu10.BothSenteView(masu_shogiban, pside));

            if (Conv_MasuHandle.OnShogiban(masuHandle))
            {
                result = Data_KomahaiyakuTransition.Map[syurui][(int)masuHandle];
            }
            else if (Conv_MasuHandle.OnKomadai(masuHandle))
            {
                switch (syurui)
                {
                case PieceType.P: result = Komahaiyaku185.n164_歩打; break;

                case PieceType.L: result = Komahaiyaku185.n165_香打; break;

                case PieceType.N: result = Komahaiyaku185.n166_桂打; break;

                case PieceType.S: result = Komahaiyaku185.n167_銀打; break;

                case PieceType.G: result = Komahaiyaku185.n168_金打; break;

                case PieceType.K: result = Komahaiyaku185.n169_王打; break;

                case PieceType.R: result = Komahaiyaku185.n170_飛打; break;

                case PieceType.B: result = Komahaiyaku185.n171_角打; break;

                case PieceType.PR: result = Komahaiyaku185.n170_飛打; break;

                case PieceType.PB: result = Komahaiyaku185.n171_角打; break;

                case PieceType.PP: result = Komahaiyaku185.n164_歩打; break;

                case PieceType.PL: result = Komahaiyaku185.n165_香打; break;

                case PieceType.PN: result = Komahaiyaku185.n166_桂打; break;

                case PieceType.PS: result = Komahaiyaku185.n167_銀打; break;

                default: result = Komahaiyaku185.n000_未設定; break;
                }
            }
            else if (Conv_MasuHandle.OnKomabukuro(masuHandle))
            {
                switch (syurui)
                {
                case PieceType.P: result = Komahaiyaku185.n172_駒袋歩; break;

                case PieceType.L: result = Komahaiyaku185.n173_駒袋香; break;

                case PieceType.N: result = Komahaiyaku185.n174_駒袋桂; break;

                case PieceType.S: result = Komahaiyaku185.n175_駒袋銀; break;

                case PieceType.G: result = Komahaiyaku185.n176_駒袋金; break;

                case PieceType.K: result = Komahaiyaku185.n177_駒袋王; break;

                case PieceType.R: result = Komahaiyaku185.n178_駒袋飛; break;

                case PieceType.B: result = Komahaiyaku185.n179_駒袋角; break;

                case PieceType.PR: result = Komahaiyaku185.n180_駒袋竜; break;

                case PieceType.PB: result = Komahaiyaku185.n181_駒袋馬; break;

                case PieceType.PP: result = Komahaiyaku185.n182_駒袋と金; break;

                case PieceType.PL: result = Komahaiyaku185.n183_駒袋杏; break;

                case PieceType.PN: result = Komahaiyaku185.n184_駒袋圭; break;

                case PieceType.PS: result = Komahaiyaku185.n185_駒袋全; break;

                default: result = Komahaiyaku185.n000_未設定; break;
                }
            }
            else
            {
                result = Komahaiyaku185.n000_未設定;
            }

            return(result);
        }