public void generate() { int[] parameters = configuration.getParameters(); map = new Map(); map.setParameters(parameters[1], parameters[2]); map.generate(parameters[3], parameters[4]); // Generate bugs for (int b = 0; b < parameters[0]; b++) addBug(new ABug()); }
/** * Sets up the world, by loading the data from the last opened configuration * file and generating a map * * @param xSize * The x size of the map to generate * @param ySize * The y size of the map to generate */ public AWorld(int xSize, int ySize) { // Load last configuration file configuration.loadLastUsed(); int[] parameters = configuration.getParameters(); map = new Map(); map.setParameters(parameters[1], parameters[2]); map.generate(parameters[3], parameters[4]); // Generate bugs for (int b = 0; b < parameters[0]; b++) addBug(new ABug()); }