master
parent
d0a6a92bc8
commit
b8bb49df2c
@ -1,11 +1,29 @@ |
|||||||
#include <catch2/catch_test_macros.hpp> |
#include <catch2/catch_test_macros.hpp> |
||||||
#include "components.hpp" |
#include "components.hpp" |
||||||
#include "dinkyecs.hpp" |
#include "dinkyecs.hpp" |
||||||
|
#include "config.hpp" |
||||||
|
#include <iostream> |
||||||
|
|
||||||
using namespace components; |
using namespace components; |
||||||
using namespace DinkyECS; |
using namespace DinkyECS; |
||||||
|
|
||||||
TEST_CASE("confirm component loading works", "[components]") { |
TEST_CASE("confirm component loading works", "[components]") { |
||||||
|
std::vector<std::string> test_list{ |
||||||
|
"assets/enemies.json", "assets/items.json", "assets/devices.json"}; |
||||||
|
|
||||||
components::ComponentMap comp_map; |
components::ComponentMap comp_map; |
||||||
components::configure(comp_map); |
components::configure(comp_map); |
||||||
|
DinkyECS::World world; |
||||||
|
|
||||||
|
for(auto test_data : test_list) { |
||||||
|
Config config(test_data); |
||||||
|
auto data_list = config.json(); |
||||||
|
|
||||||
|
for(auto& [key, data] : data_list.items()) { |
||||||
|
auto& components = data["components"]; |
||||||
|
fmt::println("TEST COMPONENT: {} from file {}", key, test_data); |
||||||
|
auto ent = world.entity(); |
||||||
|
components::configure_entity(comp_map, world, ent, components); |
||||||
|
} |
||||||
|
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue