Ejemplo n.º 1
0
            private void FindAllInInventory(InventoryModule inventory, List <Entity> list, EntityTags tag)
            {
                if (inventory == null)
                {
                    return;
                }

                foreach (var item in inventory.Storage.GetContents())
                {
                    if (item.Owner.TagList.HasTag(tag))
                    {
                        list.Add(item.Owner);
                    }

                    FindAllInInventory(item.Owner.Inventory, list, tag);
                }
            }
Ejemplo n.º 2
0
            private Entity FindInInventory(InventoryModule inventory, EntityTags tag)
            {
                if (inventory == null)
                {
                    return(null);
                }

                foreach (var item in inventory.Storage.GetContents())
                {
                    if (item.Owner.TagList.HasTag(tag))
                    {
                        return(item.Owner);
                    }

                    Entity found = FindInInventory(item.Owner.Inventory, tag);
                    if (found != null)
                    {
                        return(found);
                    }
                }

                return(null);
            }
Ejemplo n.º 3
0
            private Entity FindInInventory(InventoryModule inventory, string name)
            {
                if (inventory == null)
                {
                    return(null);
                }

                foreach (var item in inventory.Storage.GetContents())
                {
                    if (item.Owner.Name == name)
                    {
                        return(item.Owner);
                    }

                    Entity found = FindInInventory(item.Owner.Inventory, name);
                    if (found != null)
                    {
                        return(found);
                    }
                }

                return(null);
            }