ARKBreedingStats.TamingControl.updateTamingData C# (CSharp) Method

updateTamingData() private method

private updateTamingData ( ) : void
return void
        private void updateTamingData()
        {
            if (updateCalculation)
            {
                int sI = comboBoxSpecies.SelectedIndex;
                TimeSpan duration;
                int narcoBerries, narcotics;
                double te;
                bool enoughFood;
                var usedFood = new List<string>();
                var foodAmount = new List<int>();
                var foodAmountUsed = new List<int>();
                foreach (TamingFoodControl tfc in foodControls)
                {
                    usedFood.Add(tfc.foodName);
                    foodAmount.Add(tfc.amount);
                    tfc.maxFood = Taming.foodAmountNeeded(sI, (int)nudLevel.Value, tfc.foodName, Values.V.species[sI].taming.nonViolent);
                }
                Taming.tamingTimes(sI, (int)nudLevel.Value, usedFood, foodAmount, out foodAmountUsed, out duration, out narcoBerries, out narcotics, out te, out enoughFood);

                for (int f = 0; f < foodControls.Count; f++)
                {
                    foodControls[f].foodUsed = foodAmountUsed[f];
                }

                if (enoughFood)
                {
                    int bonusLevel = (int)Math.Floor((double)nudLevel.Value * te / 2);
                    labelResult.Text = "It takes " + duration.ToString(@"hh\:mm\:ss") + " (until " + (DateTime.Now + duration).ToShortTimeString() + ") to tame the " + comboBoxSpecies.SelectedItem.ToString() + "."
                                       + "\n\nTaming Effectiveness: " + Math.Round(100 * te, 1).ToString() + " %\nBonus-Level: " + bonusLevel + " (total level after Taming: " + (nudLevel.Value + bonusLevel).ToString() + ")"
                                       + "\n\n" + narcoBerries + " Narcoberries or\n" + narcotics + " Narcotics are needed";
                }
                else
                    labelResult.Text = "Not enough food to tame the creature!";
            }
        }