public boolean canPlay(Board board) {
        boolean canPlay = false;
        int originalx = this.getX();
        int originaly = this.getY();
        int limitxy = board.getSquares().length-1;

        for(Vector2 pos : this.getPossibleMoves())
        {
            if(pos.getX() < 0 || pos.getY() < 0) continue;
            if(pos.getX() > limitxy || pos.getY() > limitxy) continue;
            //5,0
            if(board.getSquares()[pos.getY()][pos.getX()].isEmpty() ||
                (board.getSquares()[this.getY()][this.getX()].getPiece() != null 
                 && board.getSquares()[this.getY()][this.getX()].getPiece().isBlack() != this.isBlack()))
            {
                this.setX(pos.getX());
                this.setY(pos.getY());

                if(!this.isInCheck(board))
                { canPlay = true; break; }
            }
        }

        this.setX(originalx);
        this.setY(originaly);

        return canPlay;
    }