Quick refactor of the config system to make it easier to refactor config.cpp/hpp later.
This commit is contained in:
parent
47f659ae8e
commit
e523aa8b02
29 changed files with 138 additions and 140 deletions
|
|
@ -130,7 +130,7 @@ TEST_CASE("ai as a module like sound/sprites", "[ai]") {
|
|||
|
||||
TEST_CASE("ai autowalker ai test", "[ai]") {
|
||||
ai::reset();
|
||||
ai::init("assets/ai.json");
|
||||
ai::init("ai");
|
||||
auto start = ai::load_state("Host::initial_state");
|
||||
auto goal = ai::load_state("Host::final_state");
|
||||
int enemy_count = 5;
|
||||
|
|
@ -170,7 +170,7 @@ TEST_CASE("ai autowalker ai test", "[ai]") {
|
|||
|
||||
TEST_CASE("Confirm EntityAI behaves as expected", "[ai]") {
|
||||
ai::reset();
|
||||
ai::init("assets/ai.json");
|
||||
ai::init("ai");
|
||||
auto ai_start = ai::load_state("Enemy::initial_state");
|
||||
auto ai_goal = ai::load_state("Enemy::final_state");
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ using namespace combat;
|
|||
|
||||
TEST_CASE("battle operations fantasy", "[combat-battle]") {
|
||||
ai::reset();
|
||||
ai::init("assets/ai.json");
|
||||
ai::init("ai");
|
||||
|
||||
auto ai_start = ai::load_state("Enemy::initial_state");
|
||||
auto ai_goal = ai::load_state("Enemy::final_state");
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ TEST_CASE("confirm component loading works", "[components]") {
|
|||
DinkyECS::World world;
|
||||
|
||||
for(auto test_data : test_list) {
|
||||
Config config(test_data);
|
||||
auto config = settings::get(test_data);
|
||||
auto data_list = config.json();
|
||||
|
||||
for(auto& [key, data] : data_list.items()) {
|
||||
|
|
@ -31,7 +31,7 @@ TEST_CASE("confirm component loading works", "[components]") {
|
|||
}
|
||||
|
||||
TEST_CASE("make sure json_mods works", "[components]") {
|
||||
Config config("assets/bosses.json");
|
||||
auto config = settings::get("bosses");
|
||||
// this confirms that loading something with an optional
|
||||
// field works with the json conversions in json_mods.hpp
|
||||
for(auto& comp_data : config["RAT_KING"]["components"]) {
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
#include <iostream>
|
||||
|
||||
TEST_CASE("confirm basic config loader ops", "[config]") {
|
||||
Config::set_base_dir("./");
|
||||
Config config("assets/devices.json");
|
||||
settings::Config::set_base_dir("./");
|
||||
auto config = settings::get("devices");
|
||||
auto data_list = config.json();
|
||||
auto the_keys = config.keys();
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ TEST_CASE("confirm basic config loader ops", "[config]") {
|
|||
}
|
||||
}
|
||||
|
||||
Config indexed("tests/config_test.json");
|
||||
auto indexed = settings::get("tests/config_test.json");
|
||||
auto& test_0 = indexed[0];
|
||||
REQUIRE(test_0["test"] == 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using namespace fmt;
|
|||
using namespace components;
|
||||
|
||||
TEST_CASE("test the loot ui", "[loot]") {
|
||||
Config items("assets/items.json");
|
||||
auto items = settings::get("assets/items.json");
|
||||
DinkyECS::World world;
|
||||
auto torch = world.entity();
|
||||
auto& data = items["TORCH_BAD"];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue