Refactored factory and component system.

This commit is contained in:
2014-03-07 01:08:54 +01:00
parent 18197bf21d
commit e65db077d5
30 changed files with 313 additions and 284 deletions
+12 -1
View File
@@ -1,5 +1,7 @@
#include "logging.h"
#include "World.h"
#include "Components/TransformComponent.h"
#include "Components/Transform.h"
#define BOOST_TEST_MODULE World
#define BOOST_TEST_DYN_LINK
@@ -50,4 +52,13 @@ BOOST_AUTO_TEST_CASE(Recycling)
world.RemoveEntity(ent11);
EntityID ent12 = world.CreateEntity(); // 1
BOOST_REQUIRE(ent11 == ent12);
}
BOOST_AUTO_TEST_CASE(ComponentCreation)
{
World world;
EntityID ent = world.CreateEntity();
BOOST_CHECK(world.AddComponent(ent, "Transform") != nullptr);
BOOST_CHECK(world.AddComponent(ent, "Input") != nullptr);
}