Consider using a map<ItemID, MyStruct> in the inventory to avoid nested loops.
In regards to the bCanCraft: If all ingredients are needed to craft, then on the first failed condition simply return false. If the loop is allowed to end, then return true:
- If a map is used then only the requirements array is to be iterated.
Hope it helps.
