コード例 #1
0
        public List <Item> FindItemsById(ItemID id, bool recurse)
        {
            List <Item> items = new List <Item>();

            for (int i = 0; i < m_Items.Count; i++)
            {
                Item item = m_Items[i];
                if (item.ItemID == id)
                {
                    items.Add(item);
                }

                if (recurse)
                {
                    List <Item> recurseItems = item.FindItemsById(id, true);

                    if (recurseItems.Count > 0)
                    {
                        items.AddRange(recurseItems);
                    }
                }
            }

            return(items);
        }