Esempio n. 1
0
		private byte[] GetLevelData(Level level)
		{
			MemoryStream ms = new MemoryStream();
			LevelWriter writer = new LevelWriter(ms);
			writer.Write(level, LevelWriter.DefaultFileVersion);
			return ms.ToArray();
		}
		private void mnuLevelExport_Click(object sender, EventArgs e)
		{
			Level level = SelectedNode.Tag as Level;
			SaveFileDialog dialog = new SaveFileDialog();
			dialog.Title = "Export level";
			dialog.Filter = "Peggle Level Files (*.dat)|*.dat";
			if (dialog.ShowDialog() == DialogResult.OK) {
				LevelWriter writer = new LevelWriter(dialog.FileName);
				writer.Write(level, LevelWriter.DefaultFileVersion);
			}
		}