Initial loot UI works to load an item by its world entity ID.
This commit is contained in:
parent
f208ca946e
commit
4b34de2109
6 changed files with 67 additions and 20 deletions
21
tests/loot.cpp
Normal file
21
tests/loot.cpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <string>
|
||||
#include "components.hpp"
|
||||
#include "dinkyecs.hpp"
|
||||
|
||||
using namespace fmt;
|
||||
using namespace components;
|
||||
|
||||
TEST_CASE("test the loot ui", "[loot]") {
|
||||
Config items("assets/items.json");
|
||||
DinkyECS::World world;
|
||||
auto torch = world.entity();
|
||||
auto& data = items["TORCH_BAD"];
|
||||
|
||||
components::init();
|
||||
components::configure_entity(world, torch, data["components"]);
|
||||
|
||||
auto& torch_sprite = world.get<Sprite>(torch);
|
||||
REQUIRE(torch_sprite.name == "torch_horizontal_floor");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue