Beispiel #1
0
 public void update(Game game, City city) {
   cityName.setText(city.getName());
   gold.setNumber(game.getMoney().getAmount());
   population.setNumber(city.getTotalPopulation());
   population.setCeiling(CityStats.totalHouseCapacity(city));
   year.setNumber(game.getYear());
 }
Beispiel #2
0
 private void addCityName(City city) {
   cityName = new JLabel(city.getName());
   cityName.setHorizontalAlignment(SwingConstants.CENTER);
   cityName.setLayout(new BoxLayout(cityName, BoxLayout.LINE_AXIS));
   cityName.setBorder(BorderFactory.createTitledBorder("City"));
   add(cityName);
 }
Beispiel #3
0
 private void addPopulationCounter(City city) {
   population =
       new Counter("Population", city.getTotalPopulation(), CityStats.totalHouseCapacity(city));
   add(population);
 }