Aura.Channel.World.Shops.PersonalShop.ForAllCustomers C# (CSharp) Метод

ForAllCustomers() приватный Метод

Executes the given action for all current customers.
private ForAllCustomers ( Action action ) : void
action Action
Результат void
		private void ForAllCustomers(Action<Creature> action)
		{
			if (this.CustomerEntityIds.Count == 0)
				return;

			var remove = new List<long>();

			lock (this.CustomerEntityIds)
			{
				foreach (var entityId in this.CustomerEntityIds)
				{
					var creature = this.Region.GetCreature(entityId);
					if (creature != null)
						action(creature);
					else
						remove.Add(entityId);
				}

				foreach (var id in remove)
					this.CustomerEntityIds.Remove(id);
			}
		}