2016-03-28 15:23:47 +00:00
|
|
|
#include "manager.hpp"
|
2016-04-03 20:08:11 +00:00
|
|
|
#include "editor.hpp"
|
2016-04-06 09:38:13 +00:00
|
|
|
#include "menu.hpp"
|
|
|
|
#include "game.hpp"
|
2016-03-10 20:58:30 +00:00
|
|
|
#include <iostream>
|
2016-03-28 17:57:55 +00:00
|
|
|
#include <memory>
|
2016-03-04 15:29:31 +00:00
|
|
|
|
|
|
|
int main() {
|
2016-04-17 13:25:21 +00:00
|
|
|
// le gestionnaire du jeu gère la pile d'états
|
2016-03-28 15:23:47 +00:00
|
|
|
Manager manager;
|
2016-04-17 13:25:21 +00:00
|
|
|
|
|
|
|
// on crée une instance de l'état "menu"
|
2016-04-11 19:11:34 +00:00
|
|
|
auto menu = std::unique_ptr<Menu>(new Menu(manager));
|
2016-03-30 12:03:52 +00:00
|
|
|
|
2016-03-25 17:40:39 +00:00
|
|
|
try {
|
2016-04-17 13:25:21 +00:00
|
|
|
// on empile l'état du menu et on démarre
|
2016-04-11 19:11:34 +00:00
|
|
|
manager.pushState(std::move(menu));
|
2016-03-28 15:23:47 +00:00
|
|
|
manager.start();
|
2016-03-25 17:40:39 +00:00
|
|
|
} catch (const std::exception& exception) {
|
|
|
|
std::cerr << "Le programme a quitté après une erreur d'exécution." << std::endl;
|
|
|
|
std::cerr << exception.what() << std::endl;
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
2016-03-04 15:29:31 +00:00
|
|
|
}
|