Rename to GameDB and GameDB::Level.

This commit is contained in:
Zed A. Shaw 2025-08-20 23:20:36 -04:00
parent c46927ea10
commit a20d701096
23 changed files with 142 additions and 151 deletions

View file

@ -10,8 +10,8 @@
using namespace lighting;
TEST_CASE("lighting a map works", "[lighting]") {
Game::init();
auto& level = Game::current();
GameDB::init();
auto& level = GameDB::current();
auto& map = *level.map;
Point light1, light2;

View file

@ -16,9 +16,9 @@ json load_test_data(const string &fname) {
}
TEST_CASE("camera control", "[map]") {
Game::init();
GameDB::init();
auto& level = Game::current();
auto& level = GameDB::current();
auto& map = *level.map;
Point center = map.center_camera({10,10}, 5, 5);
@ -34,10 +34,10 @@ TEST_CASE("camera control", "[map]") {
}
TEST_CASE("map placement test", "[map-fail]") {
Game::init();
GameDB::init();
for(int i = 0; i < 5; i++) {
auto& level = Game::create_level();
auto& level = GameDB::create_level();
for(size_t rnum = 0; rnum < level.map->room_count(); rnum++) {
Point pos;
@ -79,9 +79,9 @@ TEST_CASE("dijkstra algo test", "[map]") {
}
TEST_CASE("map image test", "[map]") {
Game::init();
GameDB::init();
auto& level = Game::current();
auto& level = GameDB::current();
Matrix map_tiles = matrix::make(7,7);
EntityGrid entity_map;

View file

@ -16,8 +16,8 @@ using std::string, std::shared_ptr;
using matrix::Matrix;
std::shared_ptr<Map> make_map() {
Game::init();
return Game::current().map;
GameDB::init();
return GameDB::current().map;
}
TEST_CASE("basic matrix iterator", "[matrix]") {
@ -259,7 +259,7 @@ TEST_CASE("prototype circle algorithm", "[matrix]") {
TEST_CASE("viewport iterator", "[matrix]") {
components::init();
textures::init();
Game::init();
GameDB::init();
size_t width = Random::uniform<size_t>(20, 22);
size_t height = Random::uniform<size_t>(21, 25);
shared_ptr<Map> map = make_map();