void IMutationEventReceiver.MutationRemoved(Hediff_AddedMutation mutation, MutationTracker tracker) { foreach (IMutationEventReceiver affinity in _aspects.OfType <IMutationEventReceiver>()) { affinity.MutationRemoved(mutation, tracker); } }
private void NotifyCompsRemoved(Hediff_AddedMutation mutation) { foreach (ThingComp parentAllComp in parent.AllComps) { if (parentAllComp == this) { continue; } if (!(parentAllComp is IMutationEventReceiver receiver)) { continue; } receiver.MutationRemoved(mutation, this); } var hediffs = Pawn.health?.hediffSet?.hediffs; if (hediffs != null) { foreach (Hediff hediff in hediffs) { if (hediff is IMutationEventReceiver receiver) { receiver.MutationRemoved(mutation, this); } else if (hediff is HediffWithComps hComps) { foreach (IMutationEventReceiver eventReceiver in hComps.comps.MakeSafe().OfType <IMutationEventReceiver>()) { eventReceiver.MutationRemoved(mutation, this); } } } } }
/// <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; InfluencesDirty = true; }
/// <summary> Called to notify this tracker that a mutation has been added. </summary> public void NotifyMutationAdded([NotNull] Hediff_AddedMutation mutation) { if (mutation == null) { throw new ArgumentNullException(nameof(mutation)); } _mutationList.Add(mutation); InfluencesDirty = true; NotifyCompsAdded(mutation); }
/// <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 NotifyCompsRemoved(Hediff_AddedMutation mutation) { foreach (ThingComp parentAllComp in parent.AllComps) { if (parentAllComp == this) { continue; } if (!(parentAllComp is IMutationEventReceiver receiver)) { continue; } receiver.MutationRemoved(mutation, this); } }