moving repo

This commit is contained in:
2024-07-04 19:58:19 -04:00
parent 6cbeb42144
commit c67dbcc62a
7 changed files with 70 additions and 18 deletions

View File

@ -1,23 +1,32 @@
#include "game.h"
#include "cursor.h"
#include "display.h"
#include "input.h"
#include "arguments.h"
// The way things are designed to work:
// 1. initializes a new ncurses wrapper c
// Note: This is done the first thing in main because ncurses
// are from procedural programming and may break otherwise (unlikely)
// 2. bind c to a new display c (that handles all output)
// 3. bind d to g for graphics
// 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)
// 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) {
cursor c;
// binds a ncurses cursor to display
display d(c);
// binds display to the game
game g(d, argc, argv);
logger log;
cursor curse;
input in(curse);
feature enabled_features = proc_args(argc,argv,curse,in,log);
display out(curse, enabled_features);
while (g.run() != game_status::terminated)
d.render();
// binds display to the game
game game_proc(in, out, argc, argv);
while (game_proc.run() != game_status::terminated)
out.render();
return 0;
}