Assets/Scripts/BoardManager.cs
/// <summary>
/// function that returns true or false in case it has one possible movement
/// </summary>
function that returns true or false in case it has one possible movement
function that returns true or false in case it has one possible movement
public bool hasOnePossibleMove(int x, int z)
    {
        bool hasAtLeastOneMove = false;
        allowedMoves = chessPieces[x, z].PossibleMove(this);
        for (int i = 0; i < 8; i++)
        {
            for (int j = 0; j < 8; j++)
            {
                if (allowedMoves[i, j])
                {
                    hasAtLeastOneMove = true;
                }
            }
        }
        return hasAtLeastOneMove;
    }
public bool hasOnePossibleMove ( int x , int z ) { bool hasAtLeastOneMove = false ; allowedMoves = chessPieces [ x , z ] . PossibleMove ( this ) ; for ( int i = 0 ; i < 8 ; i ++ ) { for ( int j = 0 ; j < 8 ; j ++ ) { if ( allowedMoves [ i , j ] ) { hasAtLeastOneMove = true ; } } } return hasAtLeastOneMove ; }
function that returns true or false in case it has one possible movement
function that returns true or false in case it has one possible movement
x
int
z
int