added: cmdline args handling
This commit is contained in:
15
src/main.cc
15
src/main.cc
@ -1,12 +1,6 @@
|
||||
#include "game.h"
|
||||
#include "cursor.h"
|
||||
#include "display.h"
|
||||
#include "input.h"
|
||||
#include "arguments.h"
|
||||
|
||||
// The way things are designed to work:
|
||||
// to be filled...
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
std::unique_ptr<cursor> curse;
|
||||
std::unique_ptr<input> in;
|
||||
@ -15,13 +9,16 @@ int main(int argc, char **argv) {
|
||||
|
||||
feature enabled_features = proc_args(argc, argv, curse, in, out, log);
|
||||
|
||||
if (enabled_features & FEATURE_PANIC)
|
||||
std::cerr << "Wrong arguments you dumbass :)" << std::endl;
|
||||
if (enabled_features &
|
||||
(FEATURE_PANIC | FEATURE_PANIC_FILE | FEATURE_CONFLICT)) {
|
||||
panic_args(enabled_features);
|
||||
return RETURN_PANICKED;
|
||||
}
|
||||
|
||||
game game_proc(enabled_features, in, out, log);
|
||||
|
||||
while (game_proc.run() != game_status::terminated)
|
||||
out->render();
|
||||
|
||||
return 0;
|
||||
return RETURN_FINE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user