示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 public ConcurrentDictionary <string, Item> GetItems(Func <Item, bool> filter)
 {
     return(ItemCache.GetItems(filter));
 }