public void newKing() { king = new Hero(people.getKing(), 2, name); Vector<Troop> heroTroops = new Vector<Troop>(); UnitType worker = game.getWorker(people); heroTroops.add(new Troop(worker, 0, king)); Army.buildArmy(heroTroops, start, this); }
public Side(String name, boolean human, People people, Player player, Position start) { this.name = name; this.human = human; this.people = people; map = new ForestMap(this); messages = new Vector<String>(); this.player = player; // Get the default start stuff for the given people. ressources = new Ressources(this.people.getStartingRessources()); System.out.println( "Ressourcenlaenge: " + ressources.getRessources().size() + " Ressourcen: " + ressources); armies = new Vector<Army>(); UnitType[] startingUnits = people.getStartingUnits(); int[] numbers = people.getNumbers(); Vector<Troop> startingTroops = new Vector<Troop>(); int i; kingType = people.getKing(); king = new Hero(kingType, 2, name); startingTroops.add(new Troop(startingUnits[0], numbers[0], king)); for (i = 1; i < numbers.length; i++) { startingTroops.add(new Troop(startingUnits[i], numbers[i])); } Army.buildArmy(startingTroops, start, this); ResearchType[] startingResearchs = people.getStartingResearchs(); int[] levels = people.getLevels(); researchs = new Vector<Research>(); for (i = 0; i < levels.length; i++) { researchs.add(new Research(startingResearchs[i], levels[i])); } buildings = new Vector<Building>(); try { addBuilding(new Building(people.getHeadQuader(), start, this)); } catch (IsAlreadyBuildException ex) { ex.printStackTrace(); System.exit(1); } }