Started working on getting Battling side done.
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:
@@ -1 +1,2 @@
|
||||
#include "TestLibrary.hpp"
|
||||
PkmnLib::Battling::BattleLibrary* TestLibrary::_library = nullptr;
|
||||
|
||||
@@ -1,21 +1,31 @@
|
||||
#ifndef PKMNLIB_TESTLIBRARY_HPP
|
||||
#define PKMNLIB_TESTLIBRARY_HPP
|
||||
|
||||
#include <Library/GrowthRates/LookupGrowthRate.hpp>
|
||||
#include "../../src/Battling/Library/BattleLibrary.hpp"
|
||||
#include "../../src/Library/Moves/MoveLibrary.hpp"
|
||||
#include "../../src/Library/PokemonLibrary.hpp"
|
||||
class TestLibrary {
|
||||
private:
|
||||
static PkmnLib::Library::PokemonLibrary* _library;
|
||||
static PkmnLib::Battling::BattleLibrary* _library;
|
||||
|
||||
public:
|
||||
static PkmnLib::Library::PokemonLibrary* GetLibrary() {
|
||||
static PkmnLib::Battling::BattleLibrary* GetLibrary() {
|
||||
if (_library == nullptr) {
|
||||
_library = BuildLibrary();
|
||||
}
|
||||
return _library;
|
||||
}
|
||||
|
||||
static PkmnLib::Library::PokemonLibrary* BuildLibrary() {
|
||||
static PkmnLib::Battling::BattleLibrary* BuildLibrary() {
|
||||
auto statCalc = new CreatureLib::Battling::BattleStatCalculator();
|
||||
return new PkmnLib::Battling::BattleLibrary(
|
||||
BuildStaticLibrary(), statCalc, new CreatureLib::Battling::DamageLibrary(),
|
||||
new CreatureLib::Battling::ExperienceLibrary(), new CreatureLib::Battling::ScriptResolver(),
|
||||
new CreatureLib::Battling::MiscLibrary());
|
||||
}
|
||||
|
||||
static PkmnLib::Library::PokemonLibrary* BuildStaticLibrary() {
|
||||
return new PkmnLib::Library::PokemonLibrary(CreatureLib::Library::LibrarySettings(100, 4),
|
||||
BuildSpeciesLibrary(), BuildMoveLibrary(), BuildItemLibrary(),
|
||||
BuildGrowthRateLibrary(), BuildTypeLibrary(), BuildNatureLibrary());
|
||||
@@ -23,6 +33,23 @@ public:
|
||||
|
||||
static PkmnLib::Library::SpeciesLibrary* BuildSpeciesLibrary() {
|
||||
auto lib = new PkmnLib::Library::SpeciesLibrary();
|
||||
lib->LoadSpecies("testSpecies", new PkmnLib::Library::PokemonSpecies(
|
||||
1, "testSpecies",
|
||||
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));
|
||||
lib->LoadSpecies(
|
||||
"testSpecies2",
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
2, "testSpecies2",
|
||||
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));
|
||||
return lib;
|
||||
}
|
||||
|
||||
@@ -38,6 +65,7 @@ public:
|
||||
|
||||
static CreatureLib::Library::GrowthRateLibrary* BuildGrowthRateLibrary() {
|
||||
auto lib = new CreatureLib::Library::GrowthRateLibrary();
|
||||
lib->AddGrowthRate("testGrowthRate", new CreatureLib::Library::LookupGrowthRate());
|
||||
return lib;
|
||||
}
|
||||
|
||||
@@ -50,7 +78,6 @@ public:
|
||||
auto lib = new PkmnLib::Library::NatureLibrary();
|
||||
return lib;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // PKMNLIB_TESTLIBRARY_HPP
|
||||
|
||||
Reference in New Issue
Block a user