So basically my game is a glorified tic tac toe game, the board is 4X4, which would mean 16 empty spaces in total. To determine the win condition the player needs to meet al conditions created and then a bool will confirm as true if conditions are met. This is the bool for the win condition and the error is here somewhere I just don't know what I did wrong:
bool Won(Seed currentPlayer)
{
bool hasWon = false;
int[,] allConditions = new int[10, 4] { {0, 1, 2, 3 }, { 4, 5, 6, 7}, { 8, 9, 10, 11}, { 12, 13, 14, 15 },
{ 0, 4, 8, 12}, { 1, 5, 9, 13}, { 2, 6, 10, 14 }, {3, 7, 11, 15 },
{0, 5, 10, 15},{3, 6, 9, 12} };
//Conditions protocol being checked to ensure parameters
for (int i = 0; i < 16; i++)
{
if (player[allConditions[i, 0]] == currentPlayer &
player[allConditions[i, 1]] == currentPlayer &
player[allConditions[i, 2]] == currentPlayer & // Double check for error if there is one
player[allConditions[i, 3]] == currentPlayer)
{
hasWon = true;
pos1 = allSpawns[allConditions[i, 0]].transform.position;
pos2 = allSpawns[allConditions[i, 3]].transform.position;
break;
}
}
return hasWon;
}