diff --git a/.gitignore b/.gitignore index 2209c6e..1617778 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ ShotGun-Pete banner.txt print.d intro.d +sleep.d diff --git a/src/include/intro.h b/src/include/intro.h index 9dee87f..4a2577f 100644 --- a/src/include/intro.h +++ b/src/include/intro.h @@ -1,23 +1,14 @@ #include +#include #include "print.h" +#include "sleep.h" using namespace std; class Intro { public: - Intro(); - Intro(Intro &&) = default; - Intro(const Intro &) = default; - Intro &operator=(Intro &&) = default; - Intro &operator=(const Intro &) = default; - ~Intro(); - void intro(); + void mainIntro(); private: }; -Intro::Intro() { -} - -Intro::~Intro() { -} diff --git a/src/include/main.h b/src/include/main.h index 9ff101a..9633418 100644 --- a/src/include/main.h +++ b/src/include/main.h @@ -1,2 +1,4 @@ #include +#include "intro.h" +#include "title.h" using namespace std; diff --git a/src/include/sleep.h b/src/include/sleep.h new file mode 100644 index 0000000..5364b60 --- /dev/null +++ b/src/include/sleep.h @@ -0,0 +1,8 @@ +#include +using namespace std; + +class Sleep{ + public: + void delay(int milliseconds); + +}; diff --git a/src/intro.cpp b/src/intro.cpp index 895e868..6a5724f 100644 --- a/src/intro.cpp +++ b/src/intro.cpp @@ -1,7 +1,6 @@ #include "include/intro.h" -void Intro::intro(){ - Print print; - print.println(""); - +void Intro::mainIntro(){ + cout << "The world didn't end with a bang. It ended with a groan.. and the scratching of death fingers against steel shutters." << endl; + std::this_thread::sleep_for(std::chrono::milliseconds(3000)); } diff --git a/src/main.cpp b/src/main.cpp index be2a847..f72a8c7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,8 +1,9 @@ #include "include/main.h" -#include "include/title.h" int main (){ Title title; title.mainTitle(); + Intro intro; + intro.mainIntro(); return 0; } diff --git a/src/sleep.cpp b/src/sleep.cpp new file mode 100644 index 0000000..e7acf29 --- /dev/null +++ b/src/sleep.cpp @@ -0,0 +1,10 @@ +#include "include/sleep.h" + +void Sleep::delay(int milliseconds){ + auto start = std::chrono::high_resolution_clock::now(); + auto duration = std::chrono::milliseconds(milliseconds); + + while (std::chrono::high_resolution_clock::now() - start < duration) { + // Do nothing, just wait + } +}