public bool AddAllFromChest(IChest chest, string actorId, out ConcurrentBag <ServerInventoryItem> addedObjects) { addedObjects = new ConcurrentBag <ServerInventoryItem>(); ConcurrentBag <string> idsForRemove = new ConcurrentBag <string>(); ConcurrentDictionary <string, ServerInventoryItem> actorObjects = null; if (chest.TryGetActorObjects(actorId, out actorObjects)) { foreach (var pair in actorObjects) { if (Add(pair.Value.Object, pair.Value.Count)) { idsForRemove.Add(pair.Value.Object.Id); addedObjects.Add(pair.Value); } } return(chest.TryRemoveActorObjectids(actorId, idsForRemove.ToList())); } return(false); }