예제 #1
0
        public bool HasItem(ObjectGuid itemGuid)
        {
            bool foundItem = InventoryObjects.ContainsKey(itemGuid) || WieldedObjects.ContainsKey(itemGuid);

            if (foundItem)
            {
                return(true);
            }

            var containers = InventoryObjects.Where(wo => wo.Value.WeenieType == WeenieType.Container).ToList();

            return(containers.Any(cnt => (cnt.Value).InventoryObjects.ContainsKey(itemGuid)));
        }
예제 #2
0
파일: Creature.cs 프로젝트: cydrith/ACE
        /// <summary>
        /// GetWilded Items
        /// </summary>
        public virtual WorldObject GetWieldedItem(ObjectGuid objectGuid)
        {
            // check wielded objects
            WorldObject inventoryItem;

            if (WieldedObjects.ContainsKey(objectGuid))
            {
                if (WieldedObjects.TryGetValue(objectGuid, out inventoryItem))
                {
                    return(inventoryItem);
                }
            }
            return(null);
        }