43 lines
1.1 KiB
Java
43 lines
1.1 KiB
Java
package shootergame.init;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Random;
|
|
|
|
import shootergame.Main;
|
|
import shootergame.world.World;
|
|
import shootergame.world.layer.Layer;
|
|
import shootergame.world.layer.layergen.LayerGenCaves;
|
|
import shootergame.world.layer.layergen.LayerGenEarth;
|
|
import shootergame.world.layer.layergen.LayerGenLavaCaves;
|
|
|
|
public class Layers
|
|
{
|
|
private static ArrayList<Layer> id_layers = new ArrayList<Layer>();
|
|
|
|
public static void init(long seed)
|
|
{
|
|
// Create all the layers
|
|
EARTH = new Layer(new Random(seed), new LayerGenEarth(), 0);
|
|
CAVES = new Layer(new Random(seed), new LayerGenCaves(), 1);
|
|
LAVA_CAVES = new Layer(new Random(seed), new LayerGenLavaCaves(), 2);
|
|
|
|
// Setup all the id-able layers
|
|
id_layers = new ArrayList<Layer>();
|
|
id_layers.add(EARTH);
|
|
id_layers.add(CAVES);
|
|
id_layers.add(LAVA_CAVES);
|
|
|
|
// Create the world and set the earth as the default layer
|
|
Main.world = new World();
|
|
Main.world.setLayer(EARTH);
|
|
}
|
|
|
|
public static Layer getLayer(int id) {
|
|
return id_layers.get(id);
|
|
}
|
|
|
|
public static Layer EARTH;
|
|
public static Layer CAVES;
|
|
public static Layer LAVA_CAVES;
|
|
}
|