Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Race
- {
- public:
- virtual void eat() = 0;
- //...
- };
- class Sun_Insensitive
- {
- //...
- };
- class Strong
- {
- //...
- };
- class Repulsive
- {
- //...
- };
- class Intelligent
- {
- //...
- };
- class Human : public Sun_Insenstive, public Strong, public, intelligent, public Race
- {
- public:
- void eat() override;
- //...
- };
- class Orc : public Repulsive, public Strong, public Race
- {
- public:
- void eat() override;
- //...
- };
- class Uruk_Hai : public Sun_Insensitive, public Repulsive, public strong, public Race
- {
- public:
- //...
- };
- Uruk_Hai* uruk = new Uruk_Hai;
- uruk->eat();
- int eat_dinner(Race* dinner_guest)
- {
- Race* r = dynamic_cast<Repulsive>(dinner_guest);
- if(r == nullptr)
- {
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment