public InventoryReference GetInventoryReference(InventoryReferenceType inventoryReferenceType, string invItem) { // todo: this is a really slow and inefficient way to search the list, albeit a small list foreach (InventoryReference invRef in GetInventoryReferenceList(inventoryReferenceType)) { if (invRef.ItemName.Trim() == invItem) { return(invRef); } } throw new Ultima5ReduxException("Asked for an inventory reference : " + invItem + " but it doesn't exist"); }
/// <summary> /// Return the full list of particular inventory references /// </summary> /// <param name="inventoryReferenceType"></param> /// <returns></returns> public List <InventoryReference> GetInventoryReferenceList(InventoryReferenceType inventoryReferenceType) { return(_invRefsDictionary[inventoryReferenceType.ToString()]); }