public PirateIcon(Pirate p) {
		
		HashMap<String, Boolean> h = p.getTable();
		BufferedImage imgBase = null;
		try {
			imgBase = ImageIO.read(getClass().getResource("/img/base.png"));
		} catch (IOException e1) {
			e1.printStackTrace();
		}
		
		for (Map.Entry<String, Boolean> entry : h.entrySet()) {
			if (entry.getValue() && !entry.getKey().equals("chapeau")) {
				BufferedImage img2 = null;
				try {
					img2 = ImageIO.read(getClass().getResource("/img/"+entry.getKey()+".png"));
				} catch (IOException e) {
					e.printStackTrace();
				}
				imgBase = PirateIcon.addImage(imgBase, img2);
			}
			if (entry.getKey().equals("chapeau")) {
				BufferedImage img2 = null;
				if (entry.getValue()) {
					try {
						img2 = ImageIO.read(getClass().getResource("/img/chapeau_noir.png"));
					} catch (IOException e) {
						e.printStackTrace();
					}
				} else {
					try {
						img2 = ImageIO.read(getClass().getResource("/img/chapeau_rouge.png"));
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				imgBase = PirateIcon.addImage(imgBase, img2);
			}
		}

		Image newimg = imgBase.getScaledInstance(190, 190, Image.SCALE_SMOOTH);  
		this.icon = new ImageIcon(newimg);
	}