Implements system for saving Evolutions.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-01-02 13:45:39 +01:00
parent 23bcec9b75
commit 5dc6695f9e
5 changed files with 141 additions and 0 deletions

View File

@@ -119,6 +119,31 @@ TEST_CASE("Able to get species base happiness", "library") {
delete species;
}
TEST_CASE("Able to set and get evolution", "library") {
auto species = new PkmnLib::Library::PokemonSpecies(
1, "foo",
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)),
0.5f, "testGrowthRate", 100, 100);
auto species2 = new PkmnLib::Library::PokemonSpecies(
2, "bar",
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)),
0.5f, "testGrowthRate", 100, 100);
species->AddEvolution(PkmnLib::Library::EvolutionData::CreateLevelEvolution(16, species2));
auto evolutions = species->GetEvolutions();
REQUIRE(evolutions.size() == 1);
auto evo = evolutions[0];
CHECK(evo.GetMethod() == PkmnLib::Library::EvolutionMethod::Level);
CHECK(evo.GetNewSpecies() == species2);
CHECK(std::any_cast<uint8_t>(evo.GetData(0)) == 16);
delete species;
delete species2;
}
#endif