/** * Sets area to be planted with given crop in given year based on user input * * @param year year in question * @param crop crop in question * @param kilomsq number square km user wants to plant with that crop */ public void updateCropLand(int year, EnumFood crop, double kilomsq) { double cropLand = 0.; for (AgriculturalUnit unit : entities) { unit.updateCropLand(year, crop, kilomsq); cropLand += unit.getCropLand(year, crop); } setCropLand(year, crop, cropLand); }