Example #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());
 }
 public void build(String constructibleName, Position position) {
   try {
     game.build(position, game.getScenario().getMod().constructible(constructibleName));
   } catch (BuildingNotFoundException e) {
     e.printStackTrace();
   }
 }
 public void buildOnSelectedPosition(String constructibleName) {
   build(constructibleName, game.getSelectedPosition());
 }
 public void destruct(Position position) {
   game.destruct(position);
 }
 public void destructSelectedPosition() {
   destruct(game.getSelectedPosition());
 }
 public void upgrade(Position position) {
   game.upgrade(position);
 }
 public void upgradeSelectedPosition() {
   upgrade(game.getSelectedPosition());
 }
 public void nextYear() {
   game.nextYear();
 }
 public void select(Position newPosition) {
   // TODO : check if the new pos is correct
   game.setSelectedPosition(newPosition);
 }
Example #10
0
 private void addYearCounter(Game game) {
   year = new Counter("Year", game.getYear());
   add(year);
 }
Example #11
0
 private void addGoldCounter(Game game) {
   gold = new Counter("Gold", game.getMoney().getAmount());
   add(gold);
 }