You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#include <QApplication>
|
|
|
|
#include <QWidget>
|
|
|
|
#include <iostream>
|
|
|
|
#include "Queue.h"
|
|
|
|
#include "Audio.h"
|
|
|
|
#include "FileManager.h"
|
|
|
|
#include "Player.h"
|
|
|
|
#include "Window.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<InputEvent>(new InputEvent);
|
|
|
|
|
|
|
|
gameQueue->registerListener(player);
|
|
|
|
gameQueue->submitEvent<CoinCollectEvent>(new CoinCollectEvent);
|
|
|
|
gameQueue->submitEvent<DamageEvent>(new DamageEvent);
|
|
|
|
|
|
|
|
Window window;
|
|
|
|
window.show();
|
|
|
|
|
|
|
|
return QApplication::exec();
|
|
|
|
}
|