Ejemplo n.º 1
0
        //香の移動範囲の色を変更する「(((Label)sender).Location)のXYを入れる」
        #region 香の移動範囲
        public static void kyoLogic(int x, int y)
        {
            KomaColor color = new KomaColor();

            foreach (Label str in Koma.駒)
            {
                if (str.Location == new System.Drawing.Point(x, tateNumberM(y)))
                {
                    if (str.Name.IndexOf("空白") == 0)
                    {
                        str.BackColor = color.移動可能場所色;
                        kyoLogic(x, tateNumberM(y));
                    }
                    else if (str.Name.IndexOf("敵") == 2)
                    {
                        str.BackColor = color.移動可能場所色;
                        if (str.Name.IndexOf("敵") == 2)
                        {
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        //金の移動範囲の色を変更する「(((Label)sender).Location)のXYを入れる」
        #region 金の移動範囲
        public static void kinLogic(int x, int y)
        {
            KomaColor color = new KomaColor();

            foreach (Label str in Koma.駒)
            {
                if (str.Location == new System.Drawing.Point(yokoNumberM(x), tateNumberM(y)))
                {
                    if (str.Name.IndexOf("空白") == 0 || str.Name.IndexOf("敵") == 2)
                    {
                        str.BackColor = color.移動可能場所色;
                    }
                }
                else if (str.Location == new System.Drawing.Point(x, tateNumberM(y)))
                {
                    if (str.Name.IndexOf("空白") == 0 || str.Name.IndexOf("敵") == 2)
                    {
                        str.BackColor = color.移動可能場所色;
                    }
                }
                else if (str.Location == new System.Drawing.Point(yokoNumberP(x), tateNumberM(y)))
                {
                    if (str.Name.IndexOf("空白") == 0 || str.Name.IndexOf("敵") == 2)
                    {
                        str.BackColor = color.移動可能場所色;
                    }
                }
                else if (str.Location == new System.Drawing.Point(yokoNumberP(x), y))
                {
                    if (str.Name.IndexOf("空白") == 0 || str.Name.IndexOf("敵") == 2)
                    {
                        str.BackColor = color.移動可能場所色;
                    }
                }
                else if (str.Location == new System.Drawing.Point(yokoNumberM(x), y))
                {
                    if (str.Name.IndexOf("空白") == 0 || str.Name.IndexOf("敵") == 2)
                    {
                        str.BackColor = color.移動可能場所色;
                    }
                }
                else if (str.Location == new System.Drawing.Point(x, tateNumberP(y)))
                {
                    if (str.Name.IndexOf("空白") == 0 || str.Name.IndexOf("敵") == 2)
                    {
                        str.BackColor = color.移動可能場所色;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        //斜めMPの移動範囲の色を変更する「(((Label)sender).Location)のXYを入れる」
        #region 斜めPMの移動範囲
        public static void nanameMPLogic(int x, int y)
        {
            KomaColor color = new KomaColor();

            foreach (Label str in Koma.駒)
            {
                if (str.Location == new System.Drawing.Point(yokoNumberM(x), tateNumberP(y)))
                {
                    if (str.Name.IndexOf("空白") == 0 || str.Name.IndexOf("味") == 2)
                    {
                        str.BackColor = color.移動可能場所色;
                        if (str.Name.IndexOf("味") == 2)
                        {
                            return;
                        }
                        nanameMPLogic(yokoNumberM(x), tateNumberP(y));
                    }
                    else
                    {
                        break;
                    }
                }
            }
        }