add subgroups for fishing rods to encounter json

This commit is contained in:
garak
2019-09-30 17:58:01 -04:00
committed by huderlem
parent 74477471a6
commit c73e20b6af
4 changed files with 41 additions and 30 deletions

View File

@@ -65,21 +65,6 @@ int main(int argc, char *argv[])
return get_custom_var(key);
});
env.add_callback("trackVar", 2, [](Arguments& args) {
static int counter = 0;
int addValue = args.at(0)->get<int>();
int checkValue = args.at(1)->get<int>();
bool over = false;
counter = (counter + addValue) % (checkValue + 1);
if (counter <= addValue) over = true;
return over;
});
env.add_callback("concat", 2, [](Arguments& args) {
string first = args.at(0)->get<string>();
string second = args.at(1)->get<string>();
@@ -106,6 +91,11 @@ int main(int argc, char *argv[])
return rawValue.substr(0, i);
});
// single argument is a json object
env.add_callback("isEmpty", 1, [](Arguments& args) {
return args.at(0)->empty();
});
try
{
env.write_with_json_file(templateFilepath, jsonfilepath, outputFilepath);