I'm trying to find a way to have objects identify events in the game by sending enumerated types as a parameter in my messaging functions (the way the objects communicate to each other). What is actually going on here, is an integer value being copied and sent by value every time these functions are called? Here's the first few piece of code, if I like this idea I'm going to build on it by adding more enumerations of the type. If you think there's a better way of doing this tell me
my enumerated type:
Code:
typedef enum {
activateplayer = 0, activateenemy
} controller_types;
One of the functions that processes the controller_types
Code:
void GameController_t::Activate(controller_types x){
switch(x) {
case activateplayer:
Clients.push_back(new Player);
break;
default:
break;
}
}
and here it is being used
Code:
GameController.Activate(activateplayer);
Im basically trying to be creative and think of good ways to do this, but i don't know if this way is the best