Game now builds and is using the new dynamic component loading but enemies do not spawn in and device events are really working. Also inventory is a giant bag of fail and needs a rewrite.

This commit is contained in:
Zed A. Shaw 2025-02-08 21:16:25 -05:00
parent 9e91c71125
commit a69be90464
23 changed files with 130 additions and 122 deletions

View file

@ -5,6 +5,7 @@
#include <nlohmann/json.hpp>
#include <fstream>
#include "components.hpp"
#include "inventory.hpp"
#include "dinkyecs.hpp"
#include "save.hpp"
#include "systems.hpp"
@ -15,17 +16,16 @@ using std::string;
using namespace components;
DinkyECS::Entity add_items(DinkyECS::ComponentMap component_map, DinkyECS::World &world, GameConfig &config) {
DinkyECS::Entity add_items(components::ComponentMap component_map, DinkyECS::World &world, GameConfig &config) {
auto sword = world.entity();
json& item_data = config.items["SWORD_RUSTY"];
world.set<InventoryItem>(sword, {item_data["inventory_count"], item_data});
DinkyECS::configure(component_map, world, sword, item_data);
components::configure_entity(component_map, world, sword, item_data);
return sword;
}
TEST_CASE("basic inventory test", "[inventory]") {
// BUG: rewrite this
REQUIRE(true == false);
/*
DinkyECS::World world;
save::load_configs(world);