Exemplo n.º 1
0
        private int lineCheck(GameBoard i_board, GameUi.ePlayers i_CurrenPlayer)
        {
            int returnevalue = 0;

            for (int i = 2; i < i_board.Size - 2; i++)
            {
                if (i_board.BoardMatrix[0, i] != null)
                {
                    if (i_board.BoardMatrix[0, i].Color == (Disc.eColors)i_CurrenPlayer)
                    {
                        returnevalue += 10;
                    }
                    else
                    {
                        returnevalue -= 10;
                    }
                }
            }

            for (int i = 2; i < i_board.Size - 2; i++)
            {
                if (i_board.BoardMatrix[i_board.Size - 1, i] != null)
                {
                    if (i_board.BoardMatrix[i_board.Size - 1, i].Color == (Disc.eColors)i_CurrenPlayer)
                    {
                        returnevalue += 10;
                    }
                    else
                    {
                        returnevalue -= 10;
                    }
                }
            }

            for (int i = 2; i < i_board.Size - 2; i++)
            {
                if (i_board.BoardMatrix[i, 0] != null)
                {
                    if (i_board.BoardMatrix[i, 0].Color == (Disc.eColors)i_CurrenPlayer)
                    {
                        returnevalue += 10;
                    }
                    else
                    {
                        returnevalue -= 10;
                    }
                }
            }

            for (int i = 2; i < i_board.Size - 2; i++)
            {
                if (i_board.BoardMatrix[i, i_board.Size - 1] != null)
                {
                    if (i_board.BoardMatrix[i, i_board.Size - 1].Color == (Disc.eColors)i_CurrenPlayer)
                    {
                        returnevalue += 10;
                    }
                    else
                    {
                        returnevalue -= 10;
                    }
                }
            }

            return(returnevalue);
        }