Exemplo n.º 1
0
        public void Add(PoolItem item)
        {
            PoolEntry entry;

            // Using autoKey and does not yet exist as an item...
            if (item.useAutoKey && !m_items.Any(x => Equals(x.key, item.key)))
            {
                entry = new PoolEntry(item.key, item.maxCount);
                m_items.Add(entry);
            }
            // Otherwise, find appropriate entry
            else
            {
                entry = m_items.FirstOrDefault(x => Equals(x.key, item.key));
            }

            if (entry == null)
            {
                return;
            }

            entry.Add(item);
        }
Exemplo n.º 2
0
 public bool Contains(PoolItem item)
 {
     return(m_items.FirstOrDefault(x => Equals(x.key, item.key)) != null);
 }