Example #1
0
        //小兵移动
        private void DogfaceMove(Pio tmpPio)
        {
            if (px != -1 && py != -1)
            {
                if (cManger.Move(px, py, tmpPio.LocX, tmpPio.LocY))
                {
                    cManger.RandomMonksChess();
                    PlaySound(Properties.Resources.move);

                    //Debug
                    SetText(cManger.getResultStr(2));
                }
                else
                {
                    PlaySound(Properties.Resources.Ding);
                }
            }
            if (isSet && cManger.DogfaceChessCount > 0)
            {
                if (cManger.Set(tmpPio.LocX, tmpPio.LocY))
                {
                    cManger.RandomMonksChess();
                    PlaySound(Properties.Resources.move);

                    //Debug
                    SetText(cManger.getResultStr(2));
                }
                else
                {
                    PlaySound(Properties.Resources.Ding);
                }
            }
            py = -1;
            px = -1;
        }
Example #2
0
        //总移动管理
        private void MoveChess(Pio tmpPio, int chessType)
        {
            if (cManger == null)
            {
                return;
            }
            if (tmpPio.PioType == 0)
            {
                if (chessType == 2)
                {
                    DogfaceMove(tmpPio);
                }
                else
                {
                    ManksMove(tmpPio);
                }
                InitePio();
            }
            else if (tmpPio.PioType == 1 || tmpPio.PioType == 2)
            {
                px = tmpPio.LocX;
                py = tmpPio.LocY;
            }

            isSet = false;
            UIChange();
            isNeedGoon = true;//开启继续功能
            cManger.GetResult();
        }
Example #3
0
        private void pio_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                return;
            }
            Pio tmpPio = sender as Pio;

            SetCursor(tmpPio.LocX, tmpPio.LocY);
            MoveChess(tmpPio, selectIndex);
        }
Example #4
0
        private void pio_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                return;
            }
            SetCursor((Bitmap)Properties.Resources.mhand4, new Point(8, 8));
            Pio tmpPio = sender as Pio;

            if (tmpPio.PioType == 1 || tmpPio.PioType == 2)
            {
                InitePio();
                tmpPio.setNullPic();
            }
        }