BROKEN: Big refactoring happening, so it compiles but game does not run and the tests fail.

This commit is contained in:
Zed A. Shaw 2025-02-08 14:03:09 -05:00
parent 96efc990c1
commit 9e91c71125
25 changed files with 128 additions and 526 deletions

View file

@ -3,7 +3,7 @@
#include <nlohmann/json.hpp>
#include <fstream>
#include "map.hpp"
#include "worldbuilder.hpp"
#include "levelmanager.hpp"
using namespace fmt;
using namespace nlohmann;
@ -15,9 +15,9 @@ json load_test_data(const string &fname) {
}
TEST_CASE("camera control", "[map]") {
Map map(20, 20);
WorldBuilder builder(map);
builder.generate_map();
LevelManager levels;
GameLevel level = levels.current();
auto &map = *level.map;
Point center = map.center_camera({10,10}, 5, 5);
@ -32,11 +32,10 @@ TEST_CASE("camera control", "[map]") {
TEST_CASE("map placement test", "[map:placement]") {
for(int i = 0; i < 50; i++) {
size_t width = Random::uniform<size_t>(9, 21);
size_t height = Random::uniform<size_t>(13, 25);
Map map(width, height);
WorldBuilder builder(map);
builder.generate_rooms();
LevelManager levels;
GameLevel level = levels.current();
auto &map = *level.map;
map.invert_space();
for(size_t rnum = 0; rnum < map.room_count(); rnum++) {