예제 #1
0
 public virtual void AdjustNutrients(NutrientSet target)
 {
     // Probably should change NutrientSet type to inherit directly or implement IEnumX
     foreach (KeyValuePair <Nutrient, NutrientAmount> kvp in Impact)
     {
         NutrientAmount val = 0;
         target.TryGetValue(kvp.Key, out val);
         target[kvp.Key] = val + kvp.Value;
     }
 }
예제 #2
0
파일: Food.cs 프로젝트: temaperacl/florine
 public void AdjustNutrients(NutrientSet target)
 {
     // Probably should change NutrientSet type to inherit directly or implement IEnumX
     foreach (KeyValuePair <Nutrient, NutrientAmount> kvp in Parent.Nutrients)
     {
         // Switch Dictionary Type to Concurrent?
         NutrientAmount val = 0;
         target.TryGetValue(kvp.Key, out val);
         target[kvp.Key] = val + kvp.Value;
     }
 }