Brought over a bunch of code from the roguelike and now will use it to generate a random map.
This commit is contained in:
parent
8d3d3b4ec3
commit
2daa1c9bd5
59 changed files with 4303 additions and 411 deletions
25
tests/tilemap.cpp
Normal file
25
tests/tilemap.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include "map.hpp"
|
||||
#include "worldbuilder.hpp"
|
||||
#include "tilemap.hpp"
|
||||
#include "config.hpp"
|
||||
#include "rand.hpp"
|
||||
|
||||
using namespace fmt;
|
||||
using std::string;
|
||||
|
||||
TEST_CASE("tilemap can load tiles and make a map", "[tilemap]") {
|
||||
size_t width = Random::uniform<size_t>(10, 25);
|
||||
size_t height = Random::uniform<size_t>(10, 33);
|
||||
|
||||
Map map(width,height);
|
||||
WorldBuilder builder(map);
|
||||
builder.generate_map();
|
||||
|
||||
TileMap tiles(map.width(), map.height());
|
||||
auto& walls = map.walls();
|
||||
tiles.load(walls);
|
||||
tiles.dump();
|
||||
REQUIRE(tiles.INVARIANT());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue