public ConcurrentDictionary <string, MmoActor> GetMmoActorsConcurrent(Func <MmoActor, bool> filter) { ConcurrentDictionary <string, MmoActor> result = new ConcurrentDictionary <string, MmoActor>(); foreach (var pair in ItemCache.GetItems((byte)ItemType.Avatar)) { var a = pair.Value.GetComponent <MmoActor>(); if (filter(a)) { result.TryAdd(pair.Key, a); } } return(result); }
public ConcurrentDictionary <string, Item> GetBotItemsConcurrent(BotItemSubType subType, Func <Item, bool> filter) { var items = ItemCache.GetItems((byte)ItemType.Bot); ConcurrentDictionary <string, Item> result = new ConcurrentDictionary <string, Item>(); foreach (var p in items) { var bot = p.Value.GetComponent <BotObject>(); if (bot.botSubType == (byte)subType) { if (filter(p.Value)) { result.TryAdd(p.Value.Id, p.Value); } } } return(result); }
public ConcurrentDictionary <string, Item> GetItems(Func <Item, bool> filter) { return(ItemCache.GetItems(filter)); }