Пример #1
0
        public void updateBoardGame(Player i_Player, int i_OldX, int i_OldY, int i_NewX, int i_newY)
        {
            BoardGame[i_NewX, i_newY] = getCellContent(i_OldX, i_OldY);
            BoardGame[i_OldX, i_OldY] = null;

            if ((i_Player.ID == e_PlayerID.FIRST && i_newY == 0) || (i_Player.ID == e_PlayerID.SECOND && i_newY == BoardSize - 1))
            {
                BoardGame[i_NewX, i_newY].Rank = e_Rank.KING;
            }

            if (Math.Abs(i_NewX - i_OldX) == 2 && Math.Abs(i_newY - i_OldY) == 2)
            {
                BoardGame[(i_OldX + i_NewX) / 2, (i_OldY + i_newY) / 2] = null;
                ////the opponent's pieces count is now iccreent by 1.
                updateCountOfPiecesForPlayerOpponentByID(i_Player.GetOpponentID(i_Player));
            }
        }