// Clicking this button adds residential buildings of a particular size determined by // the slider; that slider value is used as the index that determines which building // size to increment by private void IncrementBuildings() { int incrementAmount = _incrementSlider.IncrementAmount; _simulator.IncrementBldgs(incrementAmount, (int)_sliderBldgSize.value); UpdateTextLabels(); }
// Clicking this button adds residential buildings of a particular size determined by // the slider; that slider value is used as the index that determines which building // size to increment by // This action can only be successfully performed if there is sufficient funds to do so private void IncrementBuildings() { int incrementAmount = (int)_incrementSlider.value; int buildingIndex = (int)_sliderBldgSize.value; // Pass this to _simulator.IncrementBldgs int buildingSize = _simulator.ConstBuildingSizes[buildingIndex]; // Pass this to _fundMgr.ConstructZoning if (_fundingMgr.ConstructZoning(incrementAmount, buildingSize)) { _simulator.IncrementBldgs(incrementAmount, buildingIndex); UpdateTextLabels(); } }