Support for new version of CreatureLib.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-02-28 19:51:50 +01:00
parent dba8ae2b83
commit 29a82a5e75
19 changed files with 113 additions and 100 deletions

View File

@@ -14,9 +14,9 @@ TEST_CASE("Able to build, destroy and insert library", "library") {
new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
"default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
{"testHiddenAbility"_cnc}, new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100));
delete lib;
}
@@ -27,9 +27,9 @@ TEST_CASE("Able to insert and retrieve from library", "library") {
new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
"default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
{"testHiddenAbility"_cnc}, new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100));
auto val = lib->Get("foo"_cnc);
REQUIRE(val->GetName() == "foo");

View File

@@ -5,9 +5,10 @@
TEST_CASE("Able to create and destroy species", "library") {
auto species = new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
delete species;
}
@@ -15,9 +16,10 @@ TEST_CASE("Able to create and destroy species", "library") {
TEST_CASE("Able to get default forme", "library") {
auto species = new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
auto forme = species->GetDefaultForme();
@@ -29,9 +31,10 @@ TEST_CASE("Able to get default forme", "library") {
TEST_CASE("Able to get default forme name", "library") {
auto species = new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
auto forme = species->GetDefaultForme();
@@ -44,9 +47,10 @@ TEST_CASE("Able to get default forme name", "library") {
TEST_CASE("Able to get species name", "library") {
auto species = new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
REQUIRE(species->GetName() == "foo");
@@ -57,9 +61,10 @@ TEST_CASE("Able to get species name", "library") {
TEST_CASE("Able to get species id", "library") {
auto species = new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
REQUIRE(species->GetId() == 1);
@@ -70,9 +75,10 @@ TEST_CASE("Able to get species id", "library") {
TEST_CASE("Able to get species gender ratio", "library") {
auto species = new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
REQUIRE(species->GetGenderRate() == 0.5f);
@@ -83,9 +89,10 @@ TEST_CASE("Able to get species gender ratio", "library") {
TEST_CASE("Able to get species growth rate", "library") {
auto species = new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
REQUIRE(species->GetGrowthRate() == "testGrowthRate");
@@ -96,9 +103,10 @@ TEST_CASE("Able to get species growth rate", "library") {
TEST_CASE("Able to get species capture rate", "library") {
auto species = new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
REQUIRE(species->GetCaptureRate() == 100);
@@ -109,9 +117,10 @@ TEST_CASE("Able to get species capture rate", "library") {
TEST_CASE("Able to get species base happiness", "library") {
auto species = new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
REQUIRE(species->GetBaseHappiness() == 100);
@@ -122,15 +131,17 @@ TEST_CASE("Able to get species base happiness", "library") {
TEST_CASE("Able to set and get evolution", "library") {
auto species = new PkmnLib::Library::PokemonSpecies(
1, "foo"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
auto species2 = new PkmnLib::Library::PokemonSpecies(
2, "bar"_cnc,
new PkmnLib::Library::PokemonForme(
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
species->AddEvolution(PkmnLib::Library::EvolutionData::CreateLevelEvolution(16, species2));
@@ -145,5 +156,4 @@ TEST_CASE("Able to set and get evolution", "library") {
delete species2;
}
#endif