I have a problem with managing game actors. Each actor is stored in a list of all game actors. The base class for all actors looks like this:
public class Actor
{
public ActorType Type
{
get;
private set;
}
public ActorID Id
{
get;
private set;
}
//. . . more unnecessary code
}
Each Actor has an identification number so that I can keep track of it. Each actor has a type. I was however, unsure of how to implement this.
Should I put all actor types into a big enumeration?
public enum ActorType
{
Bullet,
AlienSpaceship,
HumanSpaceship,
Asteroid,
//etc...
}
This is what I have been thinking would be good but it just seems annoying to have to change the enumeration each time I add a new actor to the game. Is there a better way to do this?
Please help.