private void applySoliderToFrontOfView(Image i_SoliderToDraw, Point i_PointToDraw)
        {
            OvalPictureBox solider = new OvalPictureBox(i_SoliderToDraw);

            solider.Location = new Point(i_PointToDraw.X + 2, i_PointToDraw.Y + 2);
            this.Controls.Add(solider);
            solider.BringToFront();
        }
Exemple #2
0
        private void solider_StartAnimationOfSoliderMovingAfterChangePlaceOnBoard(Square i_OldSquare, Square i_NewSquare)
        {
            Control[]      soliderToMove           = this.Controls.Find(String.Format("{0}{1}", i_OldSquare.ToString(), k_SoliderPicName), false);
            Control[]      squareToMoveTheSolider  = this.Controls.Find(String.Format("{0}{1}", i_NewSquare.ToString(), k_SquarePicName), false);
            Point          currentLocationOfSquare = squareToMoveTheSolider[0].Location;
            OvalPictureBox currentSolider          = soliderToMove[0] as OvalPictureBox;
            Point          newLocation             = new Point(currentLocationOfSquare.X + 2, currentLocationOfSquare.Y + 2);

            m_IsSoliderIsMovingRightNow = true;
            currentSolider.BringToFront();
            currentSolider.startAnimationOfMovingSolider(newLocation);
            TagSolider tagOfCurrentSolider = soliderToMove[0].Tag as TagSolider;

            tagOfCurrentSolider.Name = i_NewSquare.ToString();
            soliderToMove[0].Name    = String.Format("{0}{1}", i_NewSquare.ToString(), k_SoliderPicName);
        }
Exemple #3
0
        private void applySoliderToFrontOfView(Image i_SoliderToDraw, Point i_PointToDraw, int i_Row, int i_Col, eNumberOfPlayer i_NumberOfPlayer)
        {
            OvalPictureBox solider = new OvalPictureBox(i_SoliderToDraw);

            solider.Location = new Point(i_PointToDraw.X + 2, i_PointToDraw.Y + 2);
            string stringToSetToTagName = String.Format("{0}{1}", (char)(MovementOptions.k_StartCol + i_Col), (char)(MovementOptions.k_StartRow + i_Row));

            solider.Name = string.Format("{0}{1}", stringToSetToTagName, k_SoliderPicName);
            solider.Tag  = new TagSolider(stringToSetToTagName, i_NumberOfPlayer);
            TagSolider tempTag = solider.Tag as TagSolider;

            if ((i_NumberOfPlayer == eNumberOfPlayer.Second && CheckerboardController.Instance.OtherPlayer.TypeOfPlayer != eTypeOfPlayer.Computer) || i_NumberOfPlayer == eNumberOfPlayer.First)
            {
                solider.MouseClick += solider_MouseClick;
            }

            solider.PictureOfSoliderStoppedToMove += solider_PictureOfSoliderStoppedToMove;
            this.Controls.Add(solider);
            solider.BringToFront();
        }