void MultizoneIndividualTabForm::on_saveButton_clicked()
{
    _parentWindow->saveMultizoneData(_configFile, _meshFile, _configVal,_virtualMRFList);
    savedData();
}
Ejemplo n.º 2
0
void Serialise::Save(int pType)
{
	switch (pType)
	{
	case LEVEL:
		mExtension = ".lvl";
	}

	mFilename.append(mExtension);

	std::fstream savedData(mFilename, std::ios::app);



	if (savedData.is_open())						// Check that file opened properly.
	{
		savedData << "LEVEL" << endl;				// Write the type to the top of the file on the first line and return to the next line.
		int arrayIndex = 0;							// Set first position in the 1D boolean array.
		int lineCount = 0;							// Skipping the first line for the full data write.

		while (lineCount < 339)
		{
			savedData << mSavedLevel[arrayIndex] << endl;
			arrayIndex++;
			lineCount++;
		}
		if (mGl_player.xloc != 0 || mGl_player.yloc != 0)
		{
			int poscount = 0;
			while (poscount < mGl_player.xloc)
			{
				savedData << 0;
				poscount++;
			}
			savedData << 1 << endl;
			poscount = 0;
			while (poscount < mGl_player.yloc)
			{
				savedData << 0;
				poscount++;
			}
			savedData << 1 << endl;
			lineCount += 2;
		}
		if (mGl_enemy.xloc != 0 || mGl_enemy.yloc != 0)
		{
			int poscount = 0;
			while (poscount < mGl_enemy.xloc)
			{
				savedData << 0;
				poscount++;
			}
			savedData << 1 << endl;
			poscount = 0;
			while (poscount < mGl_enemy.yloc)
			{
				savedData << 0;
				poscount++;
			}
			savedData << 1 << endl;
			lineCount += 2;
		}
		if (mGl_goal.xloc != 0 || mGl_goal.yloc != 0)
		{
			int poscount = 0;
			while (poscount < mGl_goal.xloc)
			{
				savedData << 0;
				poscount++;
			}
			savedData << 1 << endl;
			poscount = 0;
			while (poscount < mGl_goal.yloc)
			{
				savedData << 0;
				poscount++;
			}
			savedData << 1 << endl;
			lineCount += 2;
		}
		savedData << "***";					// Writes a *** terminator to the end of the file.
		savedData.close();					// Clean up by closing data stream.
	}
}