Something like a struct but with more control?

So last night I was working on an inventory system, and made a struct to create a slot variable. I had the thought to add a Boolean that would return weather or not the slot was empty, based on if an object was set. ← Really that’s my question. Aside from constantly running a check inside of a bp class, is there anything that would kind of let me do this? Basically like a struct with “rules” where certain values rely on other values in the struct. Probably not, probably a completely noobish question, but I figured I’d ask.

Yea, when it comes to the inventory system I know there are plenty of work arounds that don’t involve doing what I asked in the question, I’m just wondering if anything of that sort exists. I feel as though it would be useful. Thanks for the quick response

Assuming you had an array of these structs to represent your inventory, i think it would be enough to simply add a slot whenever an item is added, for instance, and so every slot in the array is a valid item.

Well in your specific case of returning whether a slot was empty, you could make a function called IsEmpty, that would do those necessary calculations and return whether the slot ia empty, if that’s what you’re looking for :wink: