コード例 #1
0
	static void	testJsonParser()
	{
		// SETTINGS FILE
		JsonParser test = JsonParser("Settings.json");
		test.parseFile(FileType::SETTINGS);
		Settings settings = test.getSettingsFileContent();
		std::cout << "------------- BEGINNING OF TESTING SETTINGS FILE READER -------------" << std::endl << std::endl;
		std::cout << "Resolution: " << settings.getResolutionString() << std::endl;
		std::cout << "Volume: " << settings.getVolumeString() << std::endl;
		std::cout << "Fullscreen: " << settings.getIsFullscreenString() << std::endl;
		std::cout << "Fps: " << settings.getFpsString() << std::endl;
		//std::cout << "Keys Mapping: " << settings.getKeysMapping() << std::endl;
		test.saveSettings(settings, "Settings.json");
		std::cout << std::endl << "------------- END OF TESTING SETTINGS FILE READER -------------" << std::endl << std::endl;
		// MAP FILE
		std::cout << "------------- BEGINNING OF TESTING MAP FILE READER -------------" << std::endl << std::endl;
		test.setFilePath("Maps/TestHeatZones.json");
		test.parseFile(FileType::MAP);
		MapInfos map = test.parseMap();
		map.displayMapInfos();
		std::cout << std::endl << "------------- END OF TESTING MAP FILE READER -------------" << std::endl;

		system("pause");
	}