aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
blob: b7168d63797a4a2971d08f6225628f3ae8823964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
#include <fstream>
#include "game.hpp"
#include "graphics.hpp"

#define DEFAULT_MAP_FILENAME "map/square.sokoban"

int main(int argc, char **argv)
{
    std::ifstream file;
    if (argc == 1)
        file.open(DEFAULT_MAP_FILENAME);
    else if (argc == 2)
        file.open(argv[1]);
    else
    {
        std::cout << "Usage: " << argv[0] << " [mapfile]" << std::endl;
        return 0;
    }
    Game game(file);
    Graphics graphics(game, "mario sokoban", 500, 500);
    while (graphics.isRunning())
        graphics.update();
    return 0;
}