
Originally Posted by
Xeon
I'm BACK!
Code:
class Entity
{
std::string Name;
public:
Entity(std::string name): Name(name){}
std::string GetName() const {return Name;}
};
class God: public Entity
{
Entity* entity;
public:
God(std::string name, Entity* ent):Entity(name), entity(ent){}
void ProtectionPrayer()
{
std::cout << GetName() << " protect us against " << entity->GetName() << std::endl;
}
}
int main()
{
Entity loki("xeon");
God odin("odin", &loki);
odin.ProtectionPrayer();
}
PS: Xeon should understand the joke...