<commit_before>#pragma once

#include <MY_ResourceManager.h>

Scenario * MY_ResourceManager::scenario = nullptr;
std::vector<Scenario *> MY_ResourceManager::randomEvents;
std::vector<Scenario *> MY_ResourceManager::lossEvents;
std::vector<Scenario *> MY_ResourceManager::destinationEvents;

void MY_ResourceManager::init(){
	Json::Value root;
	Json::Reader reader;
	std::string jsonLoaded = FileUtils::readFile("assets/scenarioListing.json");
	bool parsingSuccessful = reader.parse( jsonLoaded, root );
	if(!parsingSuccessful){
		Log::error("JSON parse failed: " + reader.getFormattedErrorMessages()/* + "\n" + jsonLoaded*/);
	}else{
		 Json::Value randomEventsJson = root["randomEvents"];
		 for(Json::Value::ArrayIndex i = 0; i < randomEventsJson.size(); ++i) {
			 randomEvents.push_back(new Scenario("assets/events/random/" + randomEventsJson[i].asString() + ".json"));
		 }
		 Json::Value lossEventsJson = root["lossEvents"];
		 for(Json::Value::ArrayIndex i = 0; i < lossEventsJson.size(); ++i) {
			 lossEvents.push_back(new Scenario("assets/events/loss/" + lossEventsJson[i].asString() + ".json"));
		 }
		 Json::Value destinationEventsJson = root["destinationEvents"];
		 for(Json::Value::ArrayIndex i = 0; i < destinationEventsJson.size(); ++i) {
			 destinationEvents.push_back(new Scenario("assets/events/destination/" + destinationEventsJson[i].asString() + ".json"));
		 }
	}
<commit_msg>fix for listing<commit_after>#pragma once

#include <MY_ResourceManager.h>

Scenario * MY_ResourceManager::scenario = nullptr;
std::vector<Scenario *> MY_ResourceManager::randomEvents;
std::vector<Scenario *> MY_ResourceManager::lossEvents;
std::vector<Scenario *> MY_ResourceManager::destinationEvents;

void MY_ResourceManager::init(){
	Json::Value root;
	Json::Reader reader;
	std::string jsonLoaded = FileUtils::readFile("assets/events/scenarioListing.json");
	bool parsingSuccessful = reader.parse( jsonLoaded, root );
	if(!parsingSuccessful){
		Log::error("JSON parse failed: " + reader.getFormattedErrorMessages()/* + "\n" + jsonLoaded*/);
	}else{
		 Json::Value randomEventsJson = root["randomEvents"];
		 for(Json::Value::ArrayIndex i = 0; i < randomEventsJson.size(); ++i) {
			 randomEvents.push_back(new Scenario("assets/events/random/" + randomEventsJson[i].asString() + ".json"));
		 }
		 Json::Value lossEventsJson = root["lossEvents"];
		 for(Json::Value::ArrayIndex i = 0; i < lossEventsJson.size(); ++i) {
			 lossEvents.push_back(new Scenario("assets/events/loss/" + lossEventsJson[i].asString() + ".json"));
		 }
		 Json::Value destinationEventsJson = root["destinationEvents"];
		 for(Json::Value::ArrayIndex i = 0; i < destinationEventsJson.size(); ++i) {
			 destinationEvents.push_back(new Scenario("assets/events/destination/" + destinationEventsJson[i].asString() + ".json"));
		 }
	}

{'fraction_non_alphanumeric': 0.16530394596516174, 'fraction_numerical': 0.002132954141485958, 'mean_word_length': 6.405263157894737, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5000998', 'n_tokens_mistral': 901, 'n_tokens_neox': 836, 'n_words': 150}