2016-03-25 17:40:39 +00:00
|
|
|
#include "player.hpp"
|
2016-03-10 20:58:30 +00:00
|
|
|
#include "block.hpp"
|
2016-03-28 15:23:47 +00:00
|
|
|
#include "manager.hpp"
|
2016-03-28 13:05:18 +00:00
|
|
|
#include "game.hpp"
|
2016-03-14 20:20:40 +00:00
|
|
|
#include "constants.hpp"
|
2016-03-25 17:40:39 +00:00
|
|
|
#include <cstdlib>
|
2016-03-10 20:58:30 +00:00
|
|
|
#include <iostream>
|
2016-03-28 17:57:55 +00:00
|
|
|
#include <memory>
|
2016-03-30 12:03:52 +00:00
|
|
|
#include <fstream>
|
2016-03-04 15:29:31 +00:00
|
|
|
|
|
|
|
int main() {
|
2016-03-28 15:23:47 +00:00
|
|
|
Manager manager;
|
2016-03-30 12:03:52 +00:00
|
|
|
std::shared_ptr<Game> game = std::make_shared<Game>(manager);
|
|
|
|
|
|
|
|
// ouverture du niveau
|
|
|
|
std::ifstream file;
|
|
|
|
file.open("./levels/level1.dat", std::ios::binary | std::ios::in);
|
|
|
|
game->load(file);
|
|
|
|
file.close();
|
2016-03-10 20:58:30 +00:00
|
|
|
|
2016-03-28 17:57:55 +00:00
|
|
|
manager.setView(game);
|
2016-03-10 20:58:30 +00:00
|
|
|
|
2016-03-25 17:40:39 +00:00
|
|
|
try {
|
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 << std::endl;
|
|
|
|
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
|
|
|
}
|