Zigonnage

This commit is contained in:
MarcEricMartel
2023-05-05 06:36:12 -04:00
parent 241d2a6ffb
commit 3e954843b3
2 changed files with 21 additions and 21 deletions

View File

@@ -3,19 +3,14 @@ using System;
using System.Collections.Generic;
using System.IO;
namespace JeuHoy_WPF_Natif.Model
{
public class GestionFichiersSorties : IGestionFichiers
{
public GestionFichiersSorties()
{
}
namespace JeuHoy_WPF_Natif.Model {
public class GestionFichiersSorties : IGestionFichiers {
public GestionFichiersSorties(){}
public List<Squelette> ChargerCoordonnees(string fichier)
{
public List<Squelette> ChargerCoordonnees(string fichier) {
StreamReader lecteur = new StreamReader(fichier);
string sLigne = "";
List<Squelette> lstSql = new List<Squelette>();
string sLigne = "";
string[] sTabElements = null;
if (!lecteur.EndOfStream) {
@@ -39,14 +34,16 @@ namespace JeuHoy_WPF_Natif.Model
return lstSql;
}
public int SauvegarderCoordonnees(string fichier, List<Squelette> lstData)
{
StreamWriter sw = new StreamWriter(fichier);
sw.WriteLine(lstData.Count);
sw.WriteLine(CstApplication.SKELETONCOUNT);
public int SauvegarderCoordonnees(string fichier, List<Squelette> lstData) {
StreamWriter sw = null;
try {
sw = new StreamWriter(fichier);
} catch {
return CstApplication.ERREUR;
}
try {
sw.WriteLine(lstData.Count);
sw.WriteLine(CstApplication.SKELETONCOUNT);
foreach (Squelette s in lstData) {
foreach (double point in s.Points) {
sw.Write(point.ToString() + "\t");
@@ -61,7 +58,6 @@ namespace JeuHoy_WPF_Natif.Model
sw.Flush();
sw.Close();
return CstApplication.OK;
}
}
}