For Those Interested in Making Enum Predicates

I was delighted when @Brian_Trotter shared here that using Enums for the Predicates was possible, that I wanted to share how I did it with the community:
Predicate.cs

namespace RPG.Core
{
    public enum PredicateEnum
    {
        None,
        HasQuest,
        HasInventoryItem,
        CompletedQuest
    }
}

Then for IPredicateEvaluator, I simply changed string predicate to PredicateEnum predicate

The resulting errors should then show you where to change it similarly in QuestList.cs and Inventory.cs :joy:

Finally, I updated the Cases in the two, formatting like this:

case PredicateEnum.HasInventoryItem:
5 Likes

Incredible job! You really want above and beyond. Brian’s stuff is amazing and very helpful.

1 Like

I agree!
Very helpful post, makes a lot more sense for sure to use less string ref’s
THANKS for this.

I also agree the whole team has done a great job overall!

I really look forward to the Shops and Abilities portion because I have a feeling that it will help me develop a better list for my designer as to How To build the ingredients within unity!

Basically I hope to have a list of How To’s for my team.

Any ideas?

Has anyone built a list of all the things we can do within Our RPG namespace?
I am collecting ideas and will share when complete.

Thanks

Privacy & Terms