示例#1
0
        /// <summary>
        /// Creates the descriptors for the total kcal yield of each relevant product.
        /// </summary>
        /// <param name="drop">The item dropped that could be used in food.</param>
        /// <param name="descriptors">The location where the descriptors should be placed.</param>
        /// <param name="dropRate">The quantity dropped per cycle.</param>
        /// <param name="text">The text to be displayed.</param>
        private static void CreateDescriptors(Tag drop, IList <Descriptor> descriptors,
                                              float dropRate, FoodDescriptorText text)
        {
            if (text == null)
            {
                throw new ArgumentNullException("text");
            }
            string dropName = drop.ProperName();

            foreach (var food in FoodRecipeCache.Instance.Lookup(drop))
            {
                string foodName = food.Result.ProperName();
                if (dropRate > 0.0f)
                {
                    // Determine total yield in kcal and convert to /cycle
                    string perCycle = GameUtil.AddTimeSliceText(GameUtil.GetFormattedCalories(
                                                                    food.Calories * dropRate * food.Quantity), TimeSlice.PerCycle);
                    descriptors.Add(new Descriptor(text.PerCycle.F(foodName, perCycle,
                                                                   dropName), text.PerCycleTooltip.F(foodName, perCycle, dropName)));
                }
                else
                {
                    descriptors.Add(new Descriptor(text.Stifled.F(foodName), text.
                                                   StifledTooltip));
                }
            }
        }
示例#2
0
 public LocString ThresholdValueUnits()
 {
     return(GameUtil.AddTimeSliceText(GameUtil.GetCurrentMassUnit(true), GameUtil.TimeSlice.PerSecond));
 }