/// <summary> /// preforms a full recalculation of all mutation influences /// </summary> public void RecalculateMutationInfluences() { _mutationList.Clear(); _influenceDict.Clear(); _mutationList.AddRange(Pawn.health.hediffSet.hediffs.OfType <Hediff_AddedMutation>()); MutationsCount = _mutationList.Count; AnimalClassUtilities.FillInfluenceDict(_mutationList, _influenceDict); TotalInfluence = _influenceDict.Sum(s => s.Value); }
/// <summary> Called to notify this tracker that a mutation has been removed. </summary> public void NotifyMutationRemoved([NotNull] Hediff_AddedMutation mutation) { if (mutation == null) { throw new ArgumentNullException(nameof(mutation)); } _mutationList.Remove(mutation); MutationsCount -= 1; AnimalClassUtilities.FillInfluenceDict(_mutationList, _influenceDict); TotalInfluence = _influenceDict.Select(s => s.Value).Sum(); NotifyCompsRemoved(mutation); }
private void RecalcInfluences() { AnimalClassUtilities.FillInfluenceDict(_mutationList, _influenceDict); TotalInfluence = _influenceDict.Select(s => s.Value).Sum(); MutationsCount += 1; }