Switch case alternative for Burst function mapping

I’m currently writing a burst capable HTN planning AI and I’m looking for a little advice.

Normally a HTN planner is programmed with classes and interfaces and all that which we don’t have access to in burst compiled code. For example there are many different tasks that all implement the same functions of ConditionsMet(), GetCost() etc etc.

My current solution is to use an enum for all the different tasks, and call a function containing a switch case to redirect the function call and parameters based on the enum.

While this is very doable and is working fine so far, am I missing something? Are there any better or faster techniques out there?

1 Like

a typical ecs way to do something like this is not an enum, but to have the different implementations have a different component.

then you can have one system responsible for calculating Cost() and ConditionsMet() for all Category1,
and another system responsible for calculating Cost() and ConditionsMet() for all Category2.