4#include <catch2/catch_test_macros.hpp>
6#include "hellfire/graphics/geometry/Cube.h"
7#include "hellfire/graphics/geometry/Sphere.h"
8#include "hellfire/scene/Scene.h"
11 auto test_scene = std::make_unique<hellfire::Scene>(
"Test Scene");
13 REQUIRE(test_scene->get_name() ==
"Test Scene");
14 REQUIRE(test_scene->get_entity_count() == 0);
16 SECTION(
"adding one entity increases total count") {
17 const hellfire::EntityID test_entity_id = test_scene->create_entity(
"Test Object");
18 REQUIRE(test_scene->get_entity(test_entity_id)->get_name() ==
"Test Object");
19 REQUIRE(test_scene->get_entity_count() == 1);
21 SECTION(
"removing one entity decreases total count") {
22 const hellfire::EntityID entity_to_delete_id = test_scene->create_entity(
"Test Object To Delete");
23 REQUIRE(test_scene->get_entity_count() == 1);
25 test_scene->destroy_entity(entity_to_delete_id);
26 const hellfire::Entity *deleted_entity_ptr = test_scene->get_entity(entity_to_delete_id);
28 REQUIRE(test_scene->get_entity_count() == 0);
29 REQUIRE(deleted_entity_ptr ==
nullptr);
34 const auto test_scene = std::make_unique<hellfire::Scene>(
"Test Scene");
35 REQUIRE(test_scene->get_name() ==
"Test Scene");
37 test_scene->set_name(
"Better Name V2");
38 REQUIRE(test_scene->get_name() ==
"Better Name V2");
42 const auto test_scene =
new hellfire::Scene(
"Test Scene");
43 REQUIRE(test_scene->get_entity_count() == 0);
45 test_scene->create_entity(
"Tree");
46 REQUIRE(test_scene->get_entity_count() == 1);
47 test_scene->create_entity(
"Car");
48 REQUIRE(test_scene->get_entity_count() == 2);
59TEST_CASE(
"Scene updates world matrices correctly") {