Aura.Channel.World.GameEvents.GlobalBonusManager.GetBonusMultiplier C# (CSharp) Method

GetBonusMultiplier() public method

Returns whether there are any bonuses for the given stat, and if so returns the total multiplier and the names of the events that affected it via out parameter.
public GetBonusMultiplier ( GlobalBonusStat stat, float &multiplier, string &eventNames ) : bool
stat GlobalBonusStat
multiplier float
eventNames string
return bool
		public bool GetBonusMultiplier(GlobalBonusStat stat, out float multiplier, out string eventNames)
		{
			multiplier = 0;
			eventNames = "";

			lock (_bonuses)
			{
				if (!_bonuses.Any(a => a.Stat == stat))
					return false;
			}

			var names = new HashSet<string>();

			lock (_bonuses)
			{
				foreach (var bonus in _bonuses.Where(a => a.Stat == stat))
				{
					multiplier += bonus.Multiplier;
					if (!string.IsNullOrWhiteSpace(bonus.Name))
						names.Add(bonus.Name);
				}
			}

			eventNames = string.Join(", ", names);

			return true;
		}