Assets/Scripts/BoardManager.cs
/// <summary>
/// simple function to update castling variables
/// </summary>
simple function to update castling variables
simple function to update castling variables
public void checkIfRooksOrKingMoves()
    {
        if (didWhiteRook0EverMoved == false)
        {
            if (chessPieces[0, 0] == null || chessPieces[0, 0].GetType() != typeof(TowerPiece))
            {
                didWhiteRook0EverMoved = true;
            }
        }
        if (didWhiteRook1EverMoved == false)
        {
            if (chessPieces[7, 0] == null || chessPieces[7, 0].GetType() != typeof(TowerPiece))
            {
                didWhiteRook1EverMoved = true;
            }
        }
        if (didBlackRook0EverMoved == false)
        {
            if (chessPieces[0, 7] == null || chessPieces[0, 7].GetType() != typeof(TowerPiece))
            {
                didBlackRook0EverMoved = true;
            }
        }
        if (didBlackRook1EverMoved == false)
        {
            if (chessPieces[7, 7] == null || chessPieces[7, 7].GetType() != typeof(TowerPiece))
            {
                didBlackRook1EverMoved = true;
            }
        }
        if (didWhiteKingEverMoved == false)
        {
            if (chessPieces[4, 0] == null || chessPieces[4, 0].GetType() != typeof(KingPiece))
            {
                didWhiteKingEverMoved = true;
            }
        }
        if (didBlackKingEverMoved == false)
        {
            if (chessPieces[4, 7] == null || chessPieces[4, 7].GetType() != typeof(KingPiece))
            {
                didBlackKingEverMoved = true;
            }
        }
    }
public void checkIfRooksOrKingMoves ( ) { if ( didWhiteRook0EverMoved == false ) { if ( chessPieces [ 0 , 0 ] == null || chessPieces [ 0 , 0 ] . GetType ( ) != typeof ( TowerPiece ) ) { didWhiteRook0EverMoved = true ; } } if ( didWhiteRook1EverMoved == false ) { if ( chessPieces [ 7 , 0 ] == null || chessPieces [ 7 , 0 ] . GetType ( ) != typeof ( TowerPiece ) ) { didWhiteRook1EverMoved = true ; } } if ( didBlackRook0EverMoved == false ) { if ( chessPieces [ 0 , 7 ] == null || chessPieces [ 0 , 7 ] . GetType ( ) != typeof ( TowerPiece ) ) { didBlackRook0EverMoved = true ; } } if ( didBlackRook1EverMoved == false ) { if ( chessPieces [ 7 , 7 ] == null || chessPieces [ 7 , 7 ] . GetType ( ) != typeof ( TowerPiece ) ) { didBlackRook1EverMoved = true ; } } if ( didWhiteKingEverMoved == false ) { if ( chessPieces [ 4 , 0 ] == null || chessPieces [ 4 , 0 ] . GetType ( ) != typeof ( KingPiece ) ) { didWhiteKingEverMoved = true ; } } if ( didBlackKingEverMoved == false ) { if ( chessPieces [ 4 , 7 ] == null || chessPieces [ 4 , 7 ] . GetType ( ) != typeof ( KingPiece ) ) { didBlackKingEverMoved = true ; } } }
simple function to update castling variables
simple function to update castling variables