|
|
|
|
@@ -21,38 +21,38 @@ void BuildLibrary::LogBuildTimes() {
|
|
|
|
|
std::cout << "\tScripts Time: " << ScriptsTimeMs << "ms" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BattleLibrary* BuildLibrary::Build(const std::string& pathString,
|
|
|
|
|
std::function<void(ScriptResolver*)> onScriptInitialize) {
|
|
|
|
|
auto path = std::filesystem::path(pathString);
|
|
|
|
|
|
|
|
|
|
std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
|
|
|
|
|
auto* typesLibrary = BuildTypes::Build(path / "Types.csv");
|
|
|
|
|
auto* typesLibrary = BuildTypes::Build((path / "Types.csv").generic_string());
|
|
|
|
|
TypeTimeMs =
|
|
|
|
|
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - begin).count();
|
|
|
|
|
begin = std::chrono::steady_clock::now();
|
|
|
|
|
|
|
|
|
|
auto* natureLibrary = BuildNatures::Build(path / "Natures.csv");
|
|
|
|
|
auto* natureLibrary = BuildNatures::Build((path / "Natures.csv").generic_string());
|
|
|
|
|
NaturesTimeMs =
|
|
|
|
|
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - begin).count();
|
|
|
|
|
begin = std::chrono::steady_clock::now();
|
|
|
|
|
|
|
|
|
|
auto* movesLibrary = BuildMoves::Build(path / "Moves.json", typesLibrary);
|
|
|
|
|
auto* movesLibrary = BuildMoves::Build((path / "Moves.json").generic_string(), typesLibrary);
|
|
|
|
|
MovesTimeMs =
|
|
|
|
|
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - begin).count();
|
|
|
|
|
begin = std::chrono::steady_clock::now();
|
|
|
|
|
|
|
|
|
|
auto* speciesLibrary = BuildSpecies::BuildLibrary(path / "Pokemon.json", typesLibrary, movesLibrary);
|
|
|
|
|
auto* speciesLibrary =
|
|
|
|
|
BuildSpecies::BuildLibrary((path / "Pokemon.json").generic_string(), typesLibrary, movesLibrary);
|
|
|
|
|
SpeciesTimeMs =
|
|
|
|
|
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - begin).count();
|
|
|
|
|
begin = std::chrono::steady_clock::now();
|
|
|
|
|
|
|
|
|
|
auto* itemsLibrary = BuildItems::Build(path / "Items.json");
|
|
|
|
|
auto* itemsLibrary = BuildItems::Build((path / "Items.json").generic_string());
|
|
|
|
|
ItemsTimeMs =
|
|
|
|
|
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - begin).count();
|
|
|
|
|
begin = std::chrono::steady_clock::now();
|
|
|
|
|
|
|
|
|
|
auto* growthRates = GrowthRatesBuilder::Build(path / "GrowthRates.json");
|
|
|
|
|
auto* growthRates = GrowthRatesBuilder::Build((path / "GrowthRates.json").generic_string());
|
|
|
|
|
GrowthRateTimeMs =
|
|
|
|
|
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - begin).count();
|
|
|
|
|
|
|
|
|
|
@@ -89,7 +89,7 @@ BattleLibrary* BuildLibrary::Build(const std::string& pathString,
|
|
|
|
|
continue;
|
|
|
|
|
std::ifstream in(dirEntry.path());
|
|
|
|
|
std::string contents((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>());
|
|
|
|
|
asScriptResolver->CreateScript(dirEntry.path().c_str(), contents.c_str());
|
|
|
|
|
asScriptResolver->CreateScript((const char*)dirEntry.path().c_str(), contents.c_str());
|
|
|
|
|
}
|
|
|
|
|
asScriptResolver->FinalizeModule();
|
|
|
|
|
ScriptsTimeMs =
|
|
|
|
|
|