class Gun {
public:
virtual void shoot() {
cout << "POOF";
}
};
class MultiGun : public Gun {
public:
void shoot() override {
for (int i = 0; i < 10; i++)
cout << " POOF ";
cout << "\n";
}
};
class SuperMultiGun : public MultiGun {
public:
void shoot() override {
for (int i = 0; i < 30; i++)
cout << " POOF ";
cout << "\n";
}
};
class Player {
public:
Gun *gun;
Player(Gun* gun) : gun(gun) {}
virtual void change_gun(Gun* gun) {
this->gun = gun;
}
void shoot() const {
this->gun->shoot();
}
};
class OnlyMultiGunPlayer : public Player {
public:
MultiGun* gun;
OnlyMultiGunPlayer(MultiGun *gun) : gun(gun), Player(gun) {}
};