added: list of arguments
edit: future framework of main
This commit is contained in:
29
src/main.cc
29
src/main.cc
@ -5,28 +5,23 @@
|
||||
#include "arguments.h"
|
||||
|
||||
// The way things are designed to work:
|
||||
// 1. out initializes a new display (this is a virtual one)
|
||||
// 2. out initializes output based on given args
|
||||
// This is when curse is initialized (curse.init())
|
||||
// 3. game_proc binds output to out and curses (if needed)
|
||||
// to be filled...
|
||||
|
||||
// Notes:
|
||||
// 1. game sends all output to display and gets all input from input
|
||||
// 2. display either renders to file (console) or curse
|
||||
// 3.
|
||||
int main(int argc, char **argv) {
|
||||
std::unique_ptr<cursor> curse;
|
||||
std::unique_ptr<input> in;
|
||||
std::unique_ptr<display> out;
|
||||
std::unique_ptr<logger> log;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
logger log;
|
||||
cursor curse;
|
||||
input in(curse);
|
||||
feature enabled_features = proc_args(argc, argv, curse, in, log);
|
||||
display out(curse, enabled_features);
|
||||
feature enabled_features = proc_args(argc, argv, curse, in, out, log);
|
||||
|
||||
// binds display to the game
|
||||
game game_proc(in, out, argc, argv);
|
||||
if(enabled_features & FEATURE_PANIC)
|
||||
std::cerr<<"Wrong arguments you dumbass :)"<<std::endl;
|
||||
|
||||
game game_proc(enabled_features, in, out, log);
|
||||
|
||||
while (game_proc.run() != game_status::terminated)
|
||||
out.render();
|
||||
out->render();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user