nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
main.cpp
1#include <Flow/StateManager.hpp>
2#include <Interface/Ncurses.hpp>
3#include <Interface/Colors.hpp>
4#include <Config/Globals.hpp>
5#include <Config/Arguments.hpp>
6#include <Misc/Utils.hpp>
7
8int main(int argc, char *argv[])
9{
10 try
11 {
12 // Settings
15 Arguments::parse(argc, argv);
16
17 // Misc Initializations
20 Colors::init();
21
22 // Actually running the game
23 StateManager states;
24 states.run();
25
26 // Finishing things
30 }
31 catch (...)
32 {
33 // I dont really have a nice exception-handling scheme right
34 // now. I must learn how to properly deal with them.
36 return 666;
37 }
38 return 0;
39}
40
Giga-class that switches from game states.
void run()
Main entry point and game loop.
void init()
Allocates necessary variables.
Definition Globals.cpp:82
void loadFile()
Loads configuration from the default file name.
Definition Globals.cpp:174
void saveFile()
Saves current configurations to the default file name.
Definition Globals.cpp:273
void exit()
Warns the user about any errors and warnings found during the program's execution.
Definition Globals.cpp:143
bool init()
Initializes Ncurses mode.
Definition Ncurses.cpp:3
void exit()
Quits Ncurses mode.
Definition Ncurses.cpp:25
void seed()
Must be called before any of those.
Definition Utils.cpp:41