示例#1
0
 private void save()
 {
     if (this.saveFileDialog1.ShowDialog() == DialogResult.Cancel)
     {
         return;
     }
     currentFileName = this.saveFileDialog1.FileName;
     SaveAndLoad.saveGame(panel.gameShape, this.saveFileDialog1.FileName);
 }
示例#2
0
        private void load()
        {
            if (this.openFileDialog1.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            currentFileName = this.openFileDialog1.FileName;
            GameShape g = SaveAndLoad.loadGame(this.openFileDialog1.FileName);

            panel.applyGameShape(g);
        }
示例#3
0
 private void loadGameToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (currentFileName == "")
     {
         load();
     }
     else
     {
         panel.applyGameShape(SaveAndLoad.loadGame(currentFileName));
     }
 }
示例#4
0
 private void saveGameToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (currentFileName == "")
     {
         save();
     }
     else
     {
         SaveAndLoad.saveGame(panel.gameShape, currentFileName);
     }
 }