Very simple items system to get into the inventory work.

This commit is contained in:
Zed A. Shaw 2025-01-01 13:21:01 -05:00
parent 1962b0c24e
commit 3d461bce6d
15 changed files with 94 additions and 32 deletions

View file

@ -13,6 +13,8 @@ using std::string;
TEST_CASE("basic configuration system", "[config]") {
Config config("./tests/config.json");
REQUIRE_THROWS([&]{ config["blahblah"]; }());
auto not_found = config["types"]["NOTFOUND"];
REQUIRE(not_found == nullptr);

View file

@ -20,7 +20,7 @@ TEST_CASE("load a basic gui run but don't loop", "[gui]") {
WorldBuilder builder(game_map);
builder.generate();
const auto &config = world.get_the<MapConfig>();
auto &config = world.get_the<GameConfig>();
// configure a player as a fact of the world
Player player{world.entity()};
world.set_the<Player>(player);
@ -28,7 +28,7 @@ TEST_CASE("load a basic gui run but don't loop", "[gui]") {
world.set<Position>(player.entity, {game_map.place_entity(0)});
world.set<Motion>(player.entity, {0, 0});
world.set<Combat>(player.entity, {100, 10});
world.set<Tile>(player.entity, {config.PLAYER_TILE});
world.set<Tile>(player.entity, {config.enemies["PLAYER_TILE"]["display"]});
world.set<Inventory>(player.entity, {5});
world.set<LightSource>(player.entity, {6,1});

View file

@ -8,7 +8,7 @@ using DinkyECS::Entity;
using namespace fmt;
TEST_CASE("confirm basic functionality", "[sounds]") {
REQUIRE_THROWS([&](){SoundManager sounds("./BADassets");}());
REQUIRE_THROWS([&]{SoundManager sounds("./BADassets");}());
SoundManager sounds("./assets");