Inventory Sorting Help

Hey Guys

Just looking for some pointers.

I have an inventory system which is basically a Struct Array which has a number of values in it. One of those is Category (Food/Medicine etc).

All i’m looking for is just a tip on how someone would go about sorting the inventory by this Category. Just looking for an idea on how I might attempt this.

At the moment, my inventory just displays everything the player has picked up in that particular order. I’m just not sure where i’d start when it comes to sorting it.

Thanks.

just to be sure, did you made one array for each cathegoryÙ?

The category is part of my Item Structure. It’s a reference to an enum which has multiple categories which I select from when creating a new item.