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))); }
/// <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); }