The reason I ask this, is because my constructor is very large and I have like 40 variables in the constructor initialization list. I'm just wondered if this is a common occurrence in games or in other large applications? Or is my class too bloated?
40 members are a bit too much IMO. Have you considered using more then 1 class? For example:
class Human {
public:
Human::Human(std::string name, std::string last_name, int age);
private:
std::string name;
std::string last_name;
int age;
//etc
};
class Skills {
public:
Skills::Skills(int att, int defense) ;
private:
int attack;
int defense;
//etc
};
class Boxer {
public:
Boxer(Human* hum, Skills* sk);
private:
Human* human;
Skills* skills
}; Nick Evan
Not a Llama
Moderator
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403