Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <QCoreApplication>
- #include "soldier.h"
- #include <QDebug>
- #include <QThread>
- int main(int argc, char *argv[])
- {
- QCoreApplication a(argc, argv);
- Soldier soldier("private");
- soldier.sayRank();
- soldier.Fight();
- qDebug() << "";
- QThread::msleep(1000);
- Archer archer("Lieutenant", 6);
- archer.sayRank();
- archer.Shoot();
- qDebug() << "Oh darn. I ran out of arrows. Guess I will switch to melee combat now.";
- archer.Fight();
- qDebug() << "I should've stayed at range :/";
- qDebug() << "";
- QThread::msleep(1000);
- Horseman horseman("Sergeant", "Steve");
- horseman.sayRank();
- horseman.Trample();
- horseman.Fight();
- qDebug() << horseman.horse + ", run away from here and tell my wife I loved her!";
- qDebug() << "";
- QThread::msleep(1000);
- FROR fror ("General", 8, "Mejiro McQueen");
- fror.sayRank();
- fror.Charge();
- fror.Trample();
- fror.Shoot();
- fror.Archer::Fight();
- qDebug() << fror.horse + ", run! Run towards the future and become the idol you always deserved to be!";
- qDebug() << "";
- qDebug() << "Welp...";
- QThread::msleep(1000);
- qDebug() << "Everyone is dead now.\n";
- QThread::msleep(1000);
- qDebug() << "THE END";
- return a.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment