package common.dimension;

import java.util.Map;

import common.collect.Maps;

public enum DimType {
	STAR("star", "Stern %s", true, false, false, false, false, false, true),
	PLANET("planet", "Planet %s", true, true, true, true, true, true, true),
	MOON("moon", "Mond %s", true, false, false, true, false, false, true),
	SPACE("space", "%s", false, false, false, false, false, false, true),
	SEMI("semi", "%s", false, false, true, false, false, true, true),
	AREA("area", "%s", false, false, false, false, false, false, false);
	
	private static final Map<String, DimType> LOOKUP = Maps.newHashMap();

	private final String name;
	public final String format;
	public final boolean time;
	public final boolean days;
	public final boolean weather;
	public final boolean sun;
	public final boolean moon;
	public final boolean clouds;
	public final boolean sky;
	
	private DimType(String name, String format, 
			boolean time, boolean days, boolean weather, boolean sun, boolean moon, boolean clouds, boolean sky) {
		this.name = name;		
		this.format = format;
		this.time = time;
		this.days = days;
		this.weather = weather;
		this.sun = sun;
		this.moon = moon;
		this.clouds = clouds;
		this.sky = sky;
	}
	
	public String getName() {
		return this.name;
	}
	
	public static DimType getByName(String name) {
		DimType type = LOOKUP.get(name.toLowerCase());
		return type == null ? PLANET : type;
	}
	
	static {
		for(DimType type : values()) {
			LOOKUP.put(type.name, type);
		}
	}
}
