public boolean tryMove(ArrayList<Square> arraySquares, Piece piece, MovePiece mPiece)
	{
		System.out.println("u");
		this.arraySquares=arraySquares;
		this.mPiece=mPiece;
		this.piece=piece;
		canDo=false;
		String type=piece.getType();
		
		//I try the possible moves
		if(type.equals("pawn"))
			canDo=p.tryMove(arraySquares, piece, mPiece);
		if(type.equals("bishop"))
			canDo=b.tryMove(arraySquares, piece, mPiece);
		if(type.equals("rook"))
			canDo=r.tryMove(arraySquares, piece, mPiece);
		if(type.equals("knight"))
			canDo=kn.tryMove(arraySquares, piece, mPiece);
		if(type.equals("king"))
			canDo=k.tryMove(arraySquares, piece, mPiece);
		if(type.equals("queen"))
			canDo=q.tryMove(arraySquares, piece, mPiece);
		if(type.equals("custom1"))
			canDo=cp1.tryMove(arraySquares, piece, mPiece);
		if(type.equals("custom2"))
			canDo=cp2.tryMove(arraySquares, piece, mPiece);
		
		return canDo;
	}