public void RemoveModifier(FleetVitalModifier fvm) { _modifiers.Remove(fvm); LogManager.getInstance.AddEntry("<i><color=yellow>" + _name + "</color></i> has lost a modifier: [" + fvm.value + " " + FleetVital.Format(fvm.type) + " due to " + fvm.reason + ".]"); OnModifierRemoved?.Invoke(fvm); }
public void RemoveModifier(IModifier modifier) { if (_modifiers.Remove(modifier)) { OnModifierRemoved?.Invoke(this, modifier); } }
private void RemoveExpiredModifiers() { var expiredModifiers = modifiers.Where(m => m.IsOver).ToList(); foreach (var modifier in expiredModifiers) { modifier.UnsubscribeFromUpdateEvent(); modifiers.Remove(modifier); OnModifierRemoved?.Invoke(modifier); } }