Implements system for saving Evolutions.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user