added: list of arguments

edit: future framework of main
This commit is contained in:
2024-07-05 12:11:09 -04:00
parent 0201425cf1
commit 74de68cf0d
8 changed files with 60 additions and 26 deletions

View File

@ -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;
}