Added functionality to get full stats from creature

This commit is contained in:
2019-10-10 15:08:34 +02:00
parent cbfeae94fa
commit 212a7d1ad6
7 changed files with 37 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
#ifdef TESTS_BUILD
#include "../../src/Library/CreateCreature.hpp"
#include "TestLibrary.cpp"
#include "../TestLibrary/TestLibrary.cpp"
using namespace CreatureLib::Library;
TEST_CASE( "Create basic creature", "[Library]" ) {

View File

@@ -1,51 +0,0 @@
#ifdef TESTS_BUILD
#include "../../extern/catch.hpp"
#include "../../src/Library/DataLibrary.hpp"
using namespace CreatureLib::Core;
using namespace CreatureLib::Library;
static DataLibrary* __library = nullptr;
static SpeciesLibrary* BuildSpeciesLibrary(){
auto l = new SpeciesLibrary();
l->LoadSpecies("testSpecies1", new CreatureSpecies(0, "testSpecies1",
new SpeciesVariant("default", 1,1, 10, {"fire", "water"}, StatisticSet(10,10,10,10,10,10),
{"testTalent"}, {"testSecretTalent"}),
0.5f, "testGrowthRate", 5, 100));
return l;
}
static AttackLibrary* BuildAttackLibrary(){
auto l = new AttackLibrary();
return l;
}
static ItemLibrary* BuildItemLibrary(){
auto l = new ItemLibrary();
return l;
}
static GrowthRateLibrary* BuildGrowthRateLibrary(){
auto l = new GrowthRateLibrary();
return l;
}
static DataLibrary* BuildLibrary(){
auto l = new DataLibrary(BuildSpeciesLibrary(), BuildAttackLibrary(), BuildItemLibrary(), BuildGrowthRateLibrary());
return l;
}
[[maybe_unused]]
static DataLibrary* GetLibrary(){
if (__library == nullptr){
__library = BuildLibrary();
}
return __library;
}
#ifndef LIBRARY_BUILD_TESTS
#define LIBRARY_BUILD_TESTS
#endif
#endif

View File

@@ -2,7 +2,7 @@
#define CATCH_CONFIG_MAIN
#include "../../extern/catch.hpp"
#include "TestLibrary.cpp"
#include "../TestLibrary/TestLibrary.cpp"
TEST_CASE( "Can Create Species Library", "[Library]" ) {
auto l = BuildSpeciesLibrary();