class color {
public:
float red;
float green;
float blue;
float alpha;
};
class house {
public:
color banner;
};
class tenant {
public:
house faction;
float render () {
return tenant::faction::banner::red; //here is my issue
}
};
I get an error: 'tenant::faction' is not a class or namespace
I'm sure it's just a beginner's issue, but I'm not able to word it right in google. Thanks in advance.
There are multiple issues here. You don't seem to understand the difference between instance members, static members, and enums. What is render supposed to return?
enum color {
red,
green,
blue,
alpha,
};
class house {
public:
color banner;
};
class tenant {
public:
house faction;
void render ()
{
faction.banner = red;
}
};