public void generateBuildings() {
	buildings = new Building[mapWidth][mapHeight];

	// Generate Castles
	buildings[1][mapHeight / 2 - 1] = new Castle(null, 1, mapHeight / 2 - 1);
	buildings[mapWidth - 3][mapHeight / 2 - 1] = new Castle(null, mapWidth - 3, mapHeight / 2 - 1);

	// Generate Mines

	for (int i = 0; i < mines; i++) {
	    int xMine = (int) (random.nextInt(mapWidth - 16) + 8);
	    int yMine = (int) (random.nextInt(mapHeight - 8) + 4);

	    if (map[xMine][yMine] != Tile.grass && map[xMine][yMine] != Tile.grass2 || marginBuildings(xMine, yMine, 5)) {
		i--;
	    } else {
		Mine m = new Mine(xMine, yMine);
		m.superior = false;
		buildings[xMine][yMine] = m;
		distancesLeft = distancesLeft + giveDistance(buildings[1][mapHeight / 2 - 1], m);
		distancesRight = distancesRight + giveDistance(buildings[mapWidth - 3][mapHeight / 2 - 1], m);
	    }
	}

	// Calculate fairness things

	System.out.println(distancesLeft);
	System.out.println(distancesRight);
	fairness = (double) distancesLeft / distancesRight;
	if (fairness < 1) {
	    fairness = (1 / fairness);
	    advantageLeft = true;
	}
	System.out.println(fairness);
	System.out.println(advantageLeft);

	int tries = 0;

	// Generate superiorMine(s)
	for (int i = 0; i < superiorMines && tries < 50; i++) {
	    tries++;

	    int xSMine = (int) (mapWidth / 2);

	    if (!advantageLeft) {

		xSMine--;

	    }

	    int ySMine = (int) 5 + random.nextInt(mapHeight - 10);

	    if (map[xSMine][ySMine] != Tile.grass && map[xSMine][ySMine] != Tile.grass2 || marginBuildings(xSMine, ySMine, 5)) {
		i--;
	    } else {
		Mine m = new Mine(xSMine, ySMine);
		m.superior = true;
		buildings[xSMine][ySMine] = m;
	    }
	}
    }