I'm trying to figure out what the type of the requirements field should be. My thought is to make it a conditional expression that can be passed to Bool() and evaluated at runtime, but I'm unsure how to store that in a structure. Is this possible?
Thanks!
I think your must separate the expression in variables and make an structure for each expression then you can make structure that contain other structures (expressions).
Or... you can save the expressions as strings and make a parser to evaluate it
Thanks for your reply!
Option 2 is exactly what I wanted to avoid, the Bool() function does all this parsing for me and is probably more bulletproof than anything I could ever come up with.
Mind expanding on what you mean by your first suggestion? I don't quite get it.
My use case is honestly pretty simple, these structs represent quests in a game. I figured the easiest way to know what needs to be done to complete the quest would be to simply store it, for example, logsSold >= 100. All I need to be able to do is store something like this in my structures, and then pass it to Bool() at runtime to determine if the user completed the quest or not.