mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
refactor & add test.new_world
This commit is contained in:
parent
8f37704530
commit
9b4dd8f65e
9 changed files with 57 additions and 8 deletions
|
|
@ -3,7 +3,9 @@
|
|||
#include "debug/Logger.hpp"
|
||||
#include "engine.hpp"
|
||||
#include "frontend/screens/MenuScreen.hpp"
|
||||
#include "frontend/screens/LevelScreen.hpp"
|
||||
#include "window/Window.hpp"
|
||||
#include "world/Level.hpp"
|
||||
|
||||
static debug::Logger logger("mainloop");
|
||||
|
||||
|
|
@ -13,6 +15,10 @@ Mainloop::Mainloop(Engine& engine) : engine(engine) {
|
|||
void Mainloop::run() {
|
||||
auto& time = engine.getTime();
|
||||
|
||||
engine.setLevelConsumer([this](auto level) {
|
||||
engine.setScreen(std::make_shared<LevelScreen>(&engine, std::move(level)));
|
||||
});
|
||||
|
||||
logger.info() << "starting menu screen";
|
||||
engine.setScreen(std::make_shared<MenuScreen>(&engine));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue