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
+14
View File
@@ -63,6 +63,13 @@
</Link>
<PostBuildEvent />
<PostBuildEvent />
<PreBuildEvent />
<PostBuildEvent>
<Command>$(OutDir)$(TargetName)$(TargetExt) --log_level=test_suite</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Running tests</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@@ -78,6 +85,13 @@
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>boost_unit_test_framework-vc110-1_55.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent />
<PostBuildEvent>
<Command>$(OutDir)$(TargetName)$(TargetExt) --log_level=test_suite</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Running tests</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
+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);
}