2020-02-09 12:22:54 +00:00
|
|
|
#define CATCH_CONFIG_RUNNER
|
|
|
|
#include "../extern/catch.hpp"
|
2020-02-13 10:50:01 +00:00
|
|
|
#include "BuildData/BuildItems.hpp"
|
2020-02-12 09:21:50 +00:00
|
|
|
#include "BuildData/BuildMoves.hpp"
|
2020-02-09 13:18:44 +00:00
|
|
|
#include "BuildData/BuildNatures.hpp"
|
2020-02-09 12:22:54 +00:00
|
|
|
#include "BuildData/BuildSpecies.hpp"
|
|
|
|
#include "BuildData/BuildTypes.hpp"
|
2020-02-13 11:37:32 +00:00
|
|
|
#include "BuildData/GrowthRatesBuilder.hpp"
|
2020-02-09 12:22:54 +00:00
|
|
|
#include "Library.hpp"
|
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
Catch::Session session;
|
|
|
|
|
|
|
|
std::string typesFile = "Types.csv";
|
2020-02-09 13:18:44 +00:00
|
|
|
std::string naturesFile = "Natures.csv";
|
2020-02-09 12:22:54 +00:00
|
|
|
std::string pokemonFile = "Pokemon.json";
|
2020-02-12 09:21:50 +00:00
|
|
|
std::string moveFile = "Moves.json";
|
2020-02-13 10:50:01 +00:00
|
|
|
std::string itemsFile = "Items.json";
|
2020-02-13 11:37:32 +00:00
|
|
|
std::string growthRatesFile = "GrowthRates.json";
|
2020-02-09 12:22:54 +00:00
|
|
|
|
|
|
|
using namespace Catch::clara;
|
2020-02-09 13:18:44 +00:00
|
|
|
auto cli = session.cli() | Opt(pokemonFile, "Species")["--species"]("Which species file to load.") |
|
|
|
|
Opt(typesFile, "Types")["--types"]("Which Types file to load.") |
|
2020-02-13 10:50:01 +00:00
|
|
|
Opt(naturesFile, "Natures")["--natures"]("Which Natures file to load.") |
|
|
|
|
Opt(moveFile, "Moves")["--moves"]("Which Moves file to load.") |
|
2020-02-13 11:37:32 +00:00
|
|
|
Opt(itemsFile, "Items")["--items"]("Which Items file to load.") |
|
|
|
|
Opt(growthRatesFile, "Growthrates")["--growthrates"]("Which Growthrates file to load.");
|
2020-02-09 12:22:54 +00:00
|
|
|
|
|
|
|
session.cli(cli);
|
|
|
|
|
|
|
|
int returnCode = session.applyCommandLine(argc, argv);
|
|
|
|
if (returnCode != 0) // Indicates a command line error
|
|
|
|
return returnCode;
|
|
|
|
|
|
|
|
auto typesLibrary = BuildTypes::Build(typesFile);
|
2020-02-09 13:18:44 +00:00
|
|
|
auto natureLibrary = BuildNatures::Build(naturesFile);
|
2020-02-09 12:22:54 +00:00
|
|
|
auto speciesLibrary = BuildSpecies::BuildLibrary(pokemonFile, typesLibrary);
|
2020-02-12 09:21:50 +00:00
|
|
|
auto movesLibrary = BuildMoves::Build(moveFile, typesLibrary);
|
2020-02-13 10:50:01 +00:00
|
|
|
auto itemsLibrary = BuildItems::Build(itemsFile);
|
2020-02-13 11:37:32 +00:00
|
|
|
auto growthRates = GrowthRatesBuilder::Build(growthRatesFile);
|
2020-02-09 12:22:54 +00:00
|
|
|
|
2020-02-13 10:50:01 +00:00
|
|
|
if (typesLibrary == nullptr || speciesLibrary == nullptr || natureLibrary == nullptr || movesLibrary == nullptr ||
|
2020-02-13 11:37:32 +00:00
|
|
|
itemsLibrary == nullptr || growthRates == nullptr)
|
2020-02-09 13:18:44 +00:00
|
|
|
return 1;
|
|
|
|
|
2020-02-09 12:22:54 +00:00
|
|
|
auto settings = new PkmnLib::Library::LibrarySettings(100, 4, 4096);
|
2020-02-13 11:37:32 +00:00
|
|
|
auto library = new PkmnLib::Library::PokemonLibrary(settings, speciesLibrary, movesLibrary, itemsLibrary,
|
|
|
|
growthRates, typesLibrary, natureLibrary);
|
2020-02-09 12:22:54 +00:00
|
|
|
|
|
|
|
Library::SetStaticLib(library);
|
|
|
|
|
|
|
|
return session.run();
|
|
|
|
}
|