private void departJouer(object sender, EventArgs e) { PlateauJ p = new PlateauJ(); this.Close(); p.Show(); }
public int[] charger_partie(Plateau pj) { int[] sauvegarde = null; String dossierAppli = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase); String cheminFichier = Path.Combine(dossierAppli, "save.sv"); if (File.Exists(Directory.GetCurrentDirectory() + @"\save.sv")) { IFormatter formatRestaure = new BinaryFormatter(); Stream streamRestaure = new FileStream("save.sv", FileMode.Open, FileAccess.Read, FileShare.Read); sauvegarde = (int[])formatRestaure.Deserialize(streamRestaure); PlateauJ pJ = new PlateauJ(sauvegarde); streamRestaure.Close(); pJ.Show(); } else { MessageBox.Show("Fichier de sauvegarde inexistant..."); } pj.Close(); return(sauvegarde); }
private void click_charger_partie(object sender, EventArgs e) { PlateauJ p = new PlateauJ(); PlateauJ pj = new PlateauJ(p.getSave().charger_partie(p)); }