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);
}
}