Updates to new PkmnLib, fixed same named scripts in different folders not handling both scripts.
This commit is contained in:
parent
292ca78b47
commit
27556e30e3
|
@ -79,8 +79,9 @@ PkmnLib::Library::NatureLibrary* BuildNatures::Build(const std::string& path) {
|
||||||
decreasedModifier = 1.0;
|
decreasedModifier = 1.0;
|
||||||
|
|
||||||
std::cout << "Registered nature with name '" << natureName << "'.\n";
|
std::cout << "Registered nature with name '" << natureName << "'.\n";
|
||||||
library->LoadNature(natureName, PkmnLib::Library::Nature(parsedIncreased, parsedDecreased, increasedModifier,
|
library->LoadNature(
|
||||||
decreasedModifier));
|
Arbutils::CaseInsensitiveConstString(natureName),
|
||||||
|
new PkmnLib::Library::Nature(parsedIncreased, parsedDecreased, increasedModifier, decreasedModifier));
|
||||||
}
|
}
|
||||||
return library;
|
return library;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,20 @@
|
||||||
#include "../../extern/catch.hpp"
|
#include "../../extern/catch.hpp"
|
||||||
#include "../Library.hpp"
|
#include "../Library.hpp"
|
||||||
|
|
||||||
#define CHECK_NATURE_NEUTRAL(name) \
|
#define CHECK_NATURE_NEUTRAL(name) \
|
||||||
{ \
|
{ \
|
||||||
auto nature = natureLib->GetNatureByName( #name ); \
|
auto nature = natureLib->GetNatureByName(Arbutils::CaseInsensitiveConstString(#name)); \
|
||||||
CHECK(nature.GetIncreaseModifier() == Approx(1.0)); \
|
CHECK(nature->GetIncreaseModifier() == Approx(1.0)); \
|
||||||
CHECK(nature.GetDecreaseModifier() == Approx(1.0)); \
|
CHECK(nature->GetDecreaseModifier() == Approx(1.0)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define CHECK_NATURE(name, increasedStat, decreasedStat) \
|
#define CHECK_NATURE(name, increasedStat, decreasedStat) \
|
||||||
{ \
|
{ \
|
||||||
auto nature = natureLib->GetNatureByName( #name ); \
|
auto nature = natureLib->GetNatureByName(Arbutils::CaseInsensitiveConstString(#name)); \
|
||||||
CHECK(nature.GetIncreasedStat() == PkmnLib::Library::Statistic::increasedStat); \
|
CHECK(nature->GetIncreasedStat() == PkmnLib::Library::Statistic::increasedStat); \
|
||||||
CHECK(nature.GetDecreasedStat() == PkmnLib::Library::Statistic::decreasedStat); \
|
CHECK(nature->GetDecreasedStat() == PkmnLib::Library::Statistic::decreasedStat); \
|
||||||
CHECK(nature.GetIncreaseModifier() == Approx(1.1)); \
|
CHECK(nature->GetIncreaseModifier() == Approx(1.1)); \
|
||||||
CHECK(nature.GetDecreaseModifier() == Approx(0.9)); \
|
CHECK(nature->GetDecreaseModifier() == Approx(0.9)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Nature Checks", "[natures]") {
|
TEST_CASE("Nature Checks", "[natures]") {
|
||||||
|
|
|
@ -102,7 +102,7 @@ int main(int argc, char* argv[]) {
|
||||||
continue;
|
continue;
|
||||||
std::ifstream in(dirEntry.path());
|
std::ifstream in(dirEntry.path());
|
||||||
std::string contents((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>());
|
std::string contents((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>());
|
||||||
asScriptResolver->CreateScript(dirEntry.path().filename().c_str(), contents.c_str());
|
asScriptResolver->CreateScript(dirEntry.path().c_str(), contents.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
asScriptResolver->CreateScript("TriggerEffectChance", R"(
|
asScriptResolver->CreateScript("TriggerEffectChance", R"(
|
||||||
|
|
Loading…
Reference in New Issue