public Display(Game game) { parentGame = game; baseBoard = new Board(); InitializeCardImageMap(); InitializeComponent(); }
private void loadOne_Click(object sender, EventArgs e) { String location = Application.StartupPath; String filename = "save1.txt"; String pathString = System.IO.Path.Combine(location, filename); //MessageBox.Show(pathString); if (System.IO.File.Exists(pathString)) { System.IO.StreamReader sw = new System.IO.StreamReader(pathString); int newTheme = int.Parse(sw.ReadLine()); MessageBox.Show("Game successfully loaded from " + pathString); this.Hide(); var game = new Game(newTheme); game.GameBegin(); } else { MessageBox.Show("No save file exists in " + pathString); } }
private void button1_Click(object sender, EventArgs e) { this.Hide(); var game = new Game(); game.GameBegin(); }