Example #1
0
        private bool updateBoard(string[] i_Coordinate, Player i_player)
        {
            int  countCoordinates = 0;
            int  firstCoordinate  = 0;
            int  secondCoordinate = 0;
            bool isMoveSucceed    = true;
            bool isLegalMove      = false;

            foreach (string coordinate in i_Coordinate)
            {
                if (countCoordinates == 0)
                {
                    firstCoordinate = int.Parse(coordinate);
                }

                countCoordinates++;

                if (countCoordinates == 2)
                {
                    secondCoordinate = int.Parse(coordinate);
                }
            }

            Ex02_Othelo.Point pointToSend = new Ex02_Othelo.Point(firstCoordinate, secondCoordinate);
            isLegalMove = this.m_GameModel.LegalMove(i_player, pointToSend, eOnlyCheck.No);
            if (!isLegalMove)
            {
                isMoveSucceed = false;
            }

            return(isMoveSucceed);
        }
Example #2
0
 private void updateLegalityOptionOnPicturBox_legalCellCoordinatesTransferingFromLogicToUI(Ex02_Othelo.Point i_Point)
 {
     this.m_PointForMouseHoverAndLeave = i_Point;
     this.m_PictureBoxArray[i_Point.AxisXValue, i_Point.AxisYValue].BackColor = Color.Green;
     this.m_ListOfLegalityBoardPictureBox.Add(this.m_PictureBoxArray[i_Point.AxisXValue, i_Point.AxisYValue]);
 }
Example #3
0
        private void updateCoinToPictureBox_signValueTrnsferingFromLogicToUI(char i_SignValue, Ex02_Othelo.Point i_Point)
        {
            switch (i_SignValue)
            {
            case (char)eGameSigns.X:
            {
                this.m_PictureBoxArray[i_Point.AxisXValue, i_Point.AxisYValue].Image = Properties.Resources.CoinRed;
                break;
            }

            case (char)eGameSigns.O:
            {
                this.m_PictureBoxArray[i_Point.AxisXValue, i_Point.AxisYValue].Image = Properties.Resources.CoinYellow;
                break;
            }
            }
        }