public bool checkRequirements(InventoryController.colourNames colour) { PotionInfo colour_reqs = potion_data[colour]; bool meetsRequirements = true; foreach (InventoryController.colourNames shade in Enum.GetValues(typeof(InventoryController.colourNames))) { int required = colour_reqs.getRequiredValue(shade); int holding = inventory.getColourValue(shade); if (holding < required) { meetsRequirements = false; continue; } } return(meetsRequirements); }
public void makePotion(InventoryController.colourNames colour) { if (!checkRequirements(colour)) { Debug.Log(colour.ToString() + "Potion making failed!"); } else { PotionInfo colour_reqs = potion_data[colour]; foreach (InventoryController.colourNames shade in Enum.GetValues(typeof(InventoryController.colourNames))) { int required = colour_reqs.getRequiredValue(shade); inventory.removeCards(shade, required); } //Create Potion } }