Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef SOLDIER_H
- #define SOLDIER_H
- #include <QString>
- /*
- * All soldiers of the imperial army must know their rank.
- * A soldier can be ordered to fight to the death, and no one but a soldier can receive such an order.
- */
- class Soldier
- {
- private:
- protected:
- QString rank;
- public:
- Soldier(QString assignedRank);
- void Fight();
- void sayRank();
- };
- /*
- * Some soldiers are archers; all archers are soldiers
- * Archers must know the number of arrows in their possession.
- * An archer may be ordered to shoot a distant foe, and no one but an archer can receive such an order.
- */
- class Archer : public Soldier
- {
- private:
- protected:
- int arrowcount;
- public:
- Archer(QString assignedRank, int assignedArrows);
- void sayRank();
- void Shoot();
- };
- /*
- * Some soldiers are horsemen; all horseman are soldiers.
- * Horsemen must know the horse that has been assigned to them.
- * A horseman may be ordered to trample the enemies in his path, and no one but a horseman can receive such an order.
- */
- class Horseman : public Soldier
- {
- private:
- protected:
- public:
- QString horse;
- Horseman(QString assignedRank, QString assignedHorse);
- void sayRank();
- void Trample();
- };
- /*
- * Some soldiers belong to the Flying Rain of Fire, whose members are both horsemen and archers in every respect.
- * A member of the Flying Rain may be ordered to lead the charge, and no one but a member of the Flying Rain can receive such an order.
- */
- class FROR : public Archer, public Horseman
- {
- private:
- protected:
- public:
- FROR(QString assignedRank, int assignedArrows, QString assignedHorse);
- void sayRank();
- void Charge();
- };
- #endif // SOLDIER_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement