Refactored out the main_loop so that it's not tightly coupled inside builder, and in the process found I was accidentally copying GUI and GameEngine because Builder wasn't using a &ref for them. Now they don't have a copy constructor to catch that.

This commit is contained in:
Zed A. Shaw 2024-09-10 04:38:21 -04:00
parent a7c5de6ac3
commit fff182b457
7 changed files with 27 additions and 34 deletions

View file

@ -1,4 +1,5 @@
#include "builder.hpp"
#include "gui.hpp"
#include <fmt/core.h>
int main(int argc, char *argv[])
@ -7,7 +8,7 @@ int main(int argc, char *argv[])
GameEngine game{100};
auto builder = Builder(gui, game);
builder.run();
gui.main_loop(game, builder);
return 1;
}