Located in the Actors.h file of the source code is this excerpt:
//TODO Boy I hope we can get rid of ActorTypes!
enum ActorType
{
AT_Unknown,
AT_Sphere,
AT_Teapot,
AT_TestObject,
AT_Grid,
AT_GenericMeshObject
};
The comment states a future endeavor to get rid of actor types. My question is, how do you get rid of them?
As an example, if you are doing collision detection on objects and a player actor can collide with numerous types of actors, such as zombies, ogres, aliens, walls, doors, etc., how do you avoid the dreaded switch statement that would test for each possible case to determine what type of actor was collided with? That switch statement would become unwieldy with hundreds of different types of actors.
What is an efficient way to eliminate actor types?
//TODO Boy I hope we can get rid of ActorTypes!
enum ActorType
{
AT_Unknown,
AT_Sphere,
AT_Teapot,
AT_TestObject,
AT_Grid,
AT_GenericMeshObject
};
The comment states a future endeavor to get rid of actor types. My question is, how do you get rid of them?
As an example, if you are doing collision detection on objects and a player actor can collide with numerous types of actors, such as zombies, ogres, aliens, walls, doors, etc., how do you avoid the dreaded switch statement that would test for each possible case to determine what type of actor was collided with? That switch statement would become unwieldy with hundreds of different types of actors.
What is an efficient way to eliminate actor types?