package projectzombie.init;

import java.util.ArrayList;

import projectzombie.world.layer.layergen.LayerGen;
import projectzombie.world.layer.layergen.LayerGenBossArena;
import projectzombie.world.layer.layergen.LayerGenCaves;
import projectzombie.world.layer.layergen.LayerGenEarth;
import projectzombie.world.layer.layergen.LayerGenLavaCaves;

public class LayerGenerators
{
	private static final ArrayList<LayerGen> lgens = new ArrayList<LayerGen>();
	
	private static void register(LayerGen lg) {
		lg.id = lgens.size();
		lgens.add(lg);
	}
	
	public static void init()
	{
		register(EARTH);
		register(CAVES);
		register(LAVA_CAVES);
		register(BOSS_ARENA);
	}
	
	public static LayerGen loadFromID(int id) {
		return lgens.get(id);
	}
	
	public static int getLGID(LayerGen lg) {
		for(int i=0;i<lgens.size();i++) {
			LayerGen lgi = lgens.get(i);
			if(lgi == lg) {
				return i;
			}
		}
		return -1;
	}
	
	public static final LayerGen EARTH = new LayerGenEarth();
	public static final LayerGen CAVES = new LayerGenCaves();
	public static final LayerGen LAVA_CAVES = new LayerGenLavaCaves();
	public static final LayerGen BOSS_ARENA = new LayerGenBossArena();
}
