Initial commit.
This commit is contained in:
1
tests/TestLibrary/TestLibrary.cpp
Normal file
1
tests/TestLibrary/TestLibrary.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "TestLibrary.hpp"
|
||||
49
tests/TestLibrary/TestLibrary.hpp
Normal file
49
tests/TestLibrary/TestLibrary.hpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef PKMNLIB_TESTLIBRARY_HPP
|
||||
#define PKMNLIB_TESTLIBRARY_HPP
|
||||
|
||||
#include "../../src/Library/PokemonLibrary.hpp"
|
||||
class TestLibrary {
|
||||
private:
|
||||
static PkmnLib::Library::PokemonLibrary* _library;
|
||||
|
||||
public:
|
||||
static PkmnLib::Library::PokemonLibrary* GetLibrary() {
|
||||
if (_library == nullptr) {
|
||||
_library = BuildLibrary();
|
||||
}
|
||||
return _library;
|
||||
}
|
||||
|
||||
static PkmnLib::Library::PokemonLibrary* BuildLibrary() {
|
||||
return new PkmnLib::Library::PokemonLibrary(CreatureLib::Library::LibrarySettings(100, 4),
|
||||
BuildSpeciesLibrary(), BuildAttackLibrary(), BuildItemLibrary(),
|
||||
BuildGrowthRateLibrary(), BuildTypeLibrary());
|
||||
}
|
||||
|
||||
static PkmnLib::Library::SpeciesLibrary* BuildSpeciesLibrary() {
|
||||
auto lib = new PkmnLib::Library::SpeciesLibrary();
|
||||
return lib;
|
||||
}
|
||||
|
||||
static CreatureLib::Library::AttackLibrary* BuildAttackLibrary() {
|
||||
auto lib = new CreatureLib::Library::AttackLibrary();
|
||||
return lib;
|
||||
}
|
||||
|
||||
static CreatureLib::Library::ItemLibrary* BuildItemLibrary() {
|
||||
auto lib = new CreatureLib::Library::ItemLibrary();
|
||||
return lib;
|
||||
}
|
||||
|
||||
static CreatureLib::Library::GrowthRateLibrary* BuildGrowthRateLibrary() {
|
||||
auto lib = new CreatureLib::Library::GrowthRateLibrary();
|
||||
return lib;
|
||||
}
|
||||
|
||||
static CreatureLib::Library::TypeLibrary* BuildTypeLibrary() {
|
||||
auto lib = new CreatureLib::Library::TypeLibrary();
|
||||
return lib;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // PKMNLIB_TESTLIBRARY_HPP
|
||||
Reference in New Issue
Block a user