Game game = new Game();
game.setDifficulty((Game.Difficulty) gameLevel.getSelectedToggle().getUserData());
int totalPlayers = (Integer) numberOfPlayers.getSelectedToggle().getUserData();
for (int i = 0; i < totalPlayers; i++) {
Player player = new Player();
player.setComputer(false);
player.setColor(Player.COLORS[i]);
switch (game.getDifficulty()) {
case BEGINNER:
player.setGold(12000);
case NORMAL:
player.setGold(10000);
case ADVANCED:
player.setGold(8000);
}
game.getPlayers().add(player);
}
for (int i = totalPlayers; i < 3; i++) {
Player player = new Player();
player.setComputer(true);
player.setColor(Player.COLORS[i]);
player.setName(Player.NAMES[i - totalPlayers]);
switch (game.getDifficulty()) {
case BEGINNER:
player.setGold(8000);
case NORMAL:
player.setGold(10000);
case ADVANCED:
player.setGold(12000);
}
game.getPlayers().add(player);
}
WorldGenerator worldGenerator = (WorldGenerator) worldCreation.getSelectedToggle().getUserData();