#include #include #include #include "Queue.h" #include "Audio.h" #include "FileManager.h" #include "Player.h" using std::cout, std::endl; auto audioManager = new Audio; auto fileManager = new FileManager; auto gameQueue = new GameQueue; auto inputQueue = new InputQueue; int main(int argc, char * argv[]){ QApplication app(argc, argv); /* for (int i = 0; i < 100'000; i++) audioManager->playSound(1, i); */ /* for (int i = 0; i < 10'000; i++){ fileManager->readFile("path" + std::to_string(i), [](const std::string& content){ std::cout << content << std::endl; }); fileManager->writeFile("path" + std::to_string(i), "some content" + std::to_string(i)); } */ auto player = new Player; inputQueue->registerListener(player); inputQueue->submitEvent(new InputEvent); gameQueue->registerListener(player); gameQueue->submitEvent(new CoinCollectEvent); gameQueue->submitEvent(new DamageEvent); QWidget window; window.show(); return QApplication::exec(); }