Creating a basic view

This commit is contained in:
Zoe Roux
2021-06-03 22:42:38 +02:00
parent 0d37a560d7
commit a11bd21ec3
15 changed files with 121 additions and 63 deletions
+2 -3
View File
@@ -18,8 +18,7 @@ using namespace BBM;
TEST_CASE("View creation", "[View]")
{
Wal wal;
Scene scene(wal);
Scene scene;
scene.addEntity("player")
.addComponent<PositionComponent>()
.addComponent<ControllableComponent>();
@@ -28,6 +27,6 @@ TEST_CASE("View creation", "[View]")
REQUIRE(scene.view<PositionComponent>().size() == 2);
REQUIRE(scene.view<PositionComponent, ControllableComponent>().size() == 1);
Entity &entity = *scene.getEntities().begin();
Entity &firstView = *scene.view<PositionComponent, ControllableComponent>().begin();
Entity &firstView = *scene.view<PositionComponent, ControllableComponent>().entities.begin();
REQUIRE(&entity == &firstView);
}