void updateFood(int value) { WarehouseUI warehouseUI = U.cpUI.warehouseUI; if (warehouseUI.warehouseNum < value) { value = warehouseUI.warehouseNum; } warehouseUI.updateWarehouse(-value); this.food += value; }
void updateCapacity(int value) { WarehouseUI warehouseUI = U.cpUI.warehouseUI; if (warehouseUI.warehouseNum < value) { value = warehouseUI.warehouseNum; } warehouseUI.updateWarehouse(-value); this.capacity += value; }