It is a state machines manager. It does what a state machine does: run a different script depending on a state. These state machines are usually contained in a switch case block inside the entity action. A function pointer based state machine avoids the need of this switch case, so does not matter the states amount of the machine. Each machine runs its state function straight. In the worst case, imagine the performance lost with a state machine with a hundred of different states running its last state inside a switch case. And then multiply it by a hundred state machines.

Mainly, the benefit of this code is that you can run function pointer based state machines without having any knowledge about what a pointer to a function is. Furthermore you get the benefit (not really big but necessary in some cases) of that next frame change that avoids the inherent advantage of the execution order. It has also the minor benefit of executing all the machines from a single array pass inside a single while loop. And the big benefit of been objects of any data type, not just entities. The machines do not need an object at all but there it is for its convenience.

This is not originally developed for tust but a code structure I usually write converted (with tust in mind) to an user friendly extension that I will certainly customize for my future projects laugh