What with states

I assume you can just create an enum like :

namespace EPlayerState
{
enum Type
{
Walking,
Swimming,
Flying
};
}

And make switch that redirect to different function.

There is plenty way to do that in C++, take a look at the engine class to see how they did, but state was definitely an UnrealScript features.