Looking for a little help. Trying to find a way to do this comparison.
Basically, I have 3 stats, eg, Hunger/Thirst/Oxygen. Now, at times, I can do something that can alter none, one or all of the stats at once.
What I would like to do, is after I do that thing, I would like to get the values of all the 3 stats only if they were altered and then from those, compare which one was altered the most (eg: which value is now the highest). and return that stat type and value.
Now, I can determine which stat was changed when an action takes place and it’s new value, but what i’m not sure on is how I then go about comparing only those that were changed with each other. Sometimes no stat changes and so I don’t need to compare anything, sometimes 2 of the 3 stats change so I need to compare just those, sometimes all 3 change and so I need to compare all 3 etc.
I could probably get this done using many branches (one for every possible combination), but I was wondering if there was an easier way i’m missing. In my head, this seems like this should be easy, but i’m currently drawing a blank on how to accomplish it.
So sometimes I compare nothing, sometimes i compare all 3, sometimes only hunger and thirst, or hunger and oxygen, or oxygen and thirst. I currently have a bool that gets set to true if the stat changes, but how do I go about comparing only those that change?
I hope i’ve explained this well enough. Any help would be appreciated.