Exemple #1
0
        public static ItemInfo GetItemInfo(int pollId, int id)
        {
            var entries = ItemManagerCache.GetAllItemInfoList(pollId);

            var entry = entries.FirstOrDefault(x => x.Value != null && x.Value.Id == id);

            return(entry.IsDefault() ? null : (ItemInfo)entry.Value.Clone());
        }
Exemple #2
0
        public static List <ItemInfo> GetItemInfoList(int pollId)
        {
            var fieldInfoList = new List <ItemInfo>();

            var entries  = ItemManagerCache.GetAllItemInfoList(pollId);
            var startKey = GetKeyPrefix(pollId);
            var list     = entries.Where(tuple => tuple.Key.StartsWith(startKey)).ToList();

            foreach (var pair in list)
            {
                if (pair.IsDefault())
                {
                    continue;
                }

                fieldInfoList.Add((ItemInfo)pair.Value.Clone());
            }

            return(fieldInfoList.OrderBy(fieldInfo => fieldInfo.Taxis == 0 ? int.MaxValue : fieldInfo.Taxis).ToList());
        }