package common.init;

import common.color.TextColor;

public enum MetalType {
	IRON("iron", 26, "Fe", "Eisen", 0, new ToolMaterial(2, 8.0f, 0.0f, 250, 6.0F, 2, 14, true, 15, 9, 2, 6, 5, 2).setMagnetic()),
	COPPER("copper", 29, "Cu", "Kupfer", 0),
	TIN("tin", 50, "Sn", "Zinn", 0),
	
	ALUMINIUM("aluminium", 13, "Al", "Aluminium", 1),
	LEAD("lead", 82, "Pb", "Blei", 1),
	
	POTASSIUM("potassium", 19, "K", "Kalium", true, 2),
	CALCIUM("calcium", 20, "Ca", "Calcium", true, 2),
	NICKEL("nickel", 28, "Ni", "Nickel", 2),
	ZINC("zinc", 30, "Zn", "Zink", 2),
	
	LITHIUM("lithium", 3, "Li", "Lithium", 3),
	SODIUM("sodium", 11, "Na", "Natrium", true, 3),
	PHOSPHOR("phosphor", 15, "P", "Phosphor", true, 3),
	SULFUR("sulfur", 16, "S", "Schwefel", true, 3),
	ARSENIC("arsenic", 33, "As", "Arsen", true, 3),
	SELENIUM("selenium", 34, "Se", "Selen", true, 3),
	IODINE("iodine", 53, "I", "Iod", true, 3),
	TUNGSTEN("tungsten", 74, "W", "Wolfram", 3),

	MAGNESIUM("magnesium", 12, "Mg", "Magnesium", true, 4),
	SILICON("silicon", 14, "Si", "Silizium", 4),
	TITANIUM("titanium", 22, "Ti", "Titan", 4),
	VANADIUM("vanadium", 23, "V", "Vanadium", 4),
	CHROME("chrome", 24, "Cr", "Chrom", 4),
	PLATINUM("platinum", 78, "Pt", "Platin", 4),
	GOLD("gold", 79, "Au", "Gold", 4, new ToolMaterial(0, 15.0f, 1.0f, 32, 12.0F, 0, 22, true, 7, 25, 2, 5, 3, 1)),
	
	MANGANESE("manganese", 25, "Mn", "Mangan", 5),
	COBALT("cobalt", 27, "Co", "Cobalt", 5),
	PALLADIUM("palladium", 46, "Pd", "Palladium", 5),
	SILVER("silver", 47, "Ag", "Silber", 5),
	ANTIMONY("antimony", 51, "Sb", "Antimon", true, 5),
	PRASEODYMIUM("praseodymium", 59, "Pr", "Praseodym", 5),
	NEODYMIUM("neodymium", 60, "Nd", "Neodym", 5),
	BISMUTH("bismuth", 83, "Bi", "Bismut", 5),
	
	RADIUM("radium", 88, "Ra", "Radium", 6, 0.6f),
	URANIUM("uranium", 92, "U", "Uran", 7, 1.0f),
	NEPTUNIUM("neptunium", 93, "Np", "Neptunium", 8, 2.0f),
	PLUTONIUM("plutonium", 94, "Pu", "Plutonium", 9, 4.0f),
	
	BLACK("black_metal", 666, "Bm", "Schwarzmetall", 5);


	public final int order;
	public final String sign;
	public final String name;
	public final String display;
	public final boolean isPowder;
	public final int rarity;
	public final float radioactivity;
	public final ToolMaterial material;
	
	private MetalType(String name, int order, String sign, String display, boolean isPowder, int rarity, float radioactivity, 
			ToolMaterial material) {
		this.order = order;
		this.sign = sign;
		this.name = name;
		this.display = display;
		this.isPowder = isPowder;
		this.rarity = rarity;
		this.radioactivity = radioactivity;
		this.material = material;
	}
	
	private MetalType(String name, int order, String sign, String display, boolean isPowder, int rarity) {
		this(name, order, sign, display, isPowder, rarity, 0.0f, null);
	}
	
	private MetalType(String name, int order, String sign, String display, int rarity, float radioactivity) {
		this(name, order, sign, display, false, rarity, radioactivity, null);
	}
	
	private MetalType(String name, int order, String sign, String display, int rarity) {
		this(name, order, sign, display, false, rarity, 0.0f, null);
	}
	
	private MetalType(String name, int order, String sign, String display, int rarity, ToolMaterial material) {
		this(name, order, sign, display, false, rarity, 0.0f, material);
	}
	
	public String formatSymbol() {
		return TextColor.YELLOW + "Element-Symbol: " + TextColor.ORANGE + this.order + " " + this.sign;
	}
	
	public String formatRarity() {
		return TextColor.DMAGENTA + "Seltenheit: " + TextColor.NEON + "" + (this.rarity + 1);
	}
	
	public String formatRadioactivity() {
		return TextColor.RED + "Radioaktivität: " + TextColor.GREEN + String.format("%.1f RN", this.radioactivity * 100.0f);
	}
    
    public boolean isMagnetic() {
    	return this == IRON || this == NICKEL || this == COBALT;
    }
}
