Merging with develop and reworking all systems

This commit is contained in:
Zoe Roux
2021-06-04 01:04:05 +02:00
41 changed files with 661 additions and 333 deletions
+6 -5
View File
@@ -4,13 +4,13 @@
#include "Entity/Entity.hpp"
#include "Component/Position/PositionComponent.hpp"
#include "System/Movable/MovableSystem.hpp"
#include "System/Controllable/ControllableSystem.hpp"
#include <catch2/catch.hpp>
#include <Wal.hpp>
#include <Component/Controllable/ControllableComponent.hpp>
#define private public
#include "System/Controllable/ControllableSystem.hpp"
#include "System/Movable/MovableSystem.hpp"
#include <Component/Controllable/ControllableComponent.hpp>
#include <Component/Movable/MovableComponent.hpp>
using namespace WAL;
@@ -19,6 +19,7 @@ using namespace BBM;
TEST_CASE("Move test", "[Component][System]")
{
Wal wal;
Scene scene;
scene.addEntity("player")
.addComponent<ControllableComponent>()
@@ -30,13 +31,13 @@ TEST_CASE("Move test", "[Component][System]")
entity.getComponent<ControllableComponent>().move = Vector2f(1, 1);
ControllableSystem controllable;
ControllableSystem controllable(wal);
controllable.onUpdate(entity, std::chrono::nanoseconds(1));
controllable.onFixedUpdate(entity);
REQUIRE(entity.getComponent<MovableComponent>()._acceleration.x > 0);
REQUIRE(entity.getComponent<MovableComponent>()._acceleration.z > 0);
MovableSystem movable;
MovableSystem movable(wal);
movable.onUpdate(entity, std::chrono::nanoseconds(1));
movable.onFixedUpdate(entity);
REQUIRE(entity.getComponent<MovableComponent>()._velocity.x > 0);