@Override
	public void componentActivated(AbstractComponent source) {
		for (int i = 0; i < city.getBuildings().size(); i++) {
			if (source == buildingViewBuildings.get(i).buyButton) {
				if (city.getBuildings().get(i).getStatus() == false && city.getGold() - city.getBuildings().get(i).getGoldcost() >= 0 && city.getFood() - city.getBuildings().get(i).getFoodcost() >= 0) {
					city.changeGold(-city.getBuildings().get(i).getGoldcost());
					city.changeFood(-city.getBuildings().get(i).getFoodcost());
					city.getBuildings().get(i).setStatus(true);
				}
			}
			if (source == buildingViewBuildings.get(i).stopButton) {
				if (city.getBuildings().get(i).getStatus()) {
					city.changeGold(city.getBuildings().get(i).getGoldcost());
					city.changeFood(city.getBuildings().get(i).getFoodcost());
					city.getBuildings().get(i).setStatus(false);
					city.getBuildings().get(i).setBuildingtimeLeft(city.getBuildings().get(i).getBuildingtime());
				}
			}
		}
	}