diff --git a/ProjectPlane/ProjectPlane/MapsCollection.cs b/ProjectPlane/ProjectPlane/MapsCollection.cs index 50643a9..b443f07 100644 --- a/ProjectPlane/ProjectPlane/MapsCollection.cs +++ b/ProjectPlane/ProjectPlane/MapsCollection.cs @@ -36,7 +36,7 @@ namespace ProjectPlane /// private readonly char separatorData = ';'; - public MapsCollection(int pictureWidth, int pictureHeight) + public MapsCollection(int pictureWidth, int pictureHeight) { _mapStorages = new Dictionary>(); _pictureWidth = pictureWidth; @@ -84,7 +84,7 @@ namespace ProjectPlane byte[] info = new UTF8Encoding(true).GetBytes(text); stream.Write(info, 0, info.Length); } - public bool SaveData(string filename) + public void SaveData(string filename) { if (File.Exists(filename)) { @@ -102,7 +102,6 @@ namespace ProjectPlane ); } } - } @@ -111,11 +110,11 @@ namespace ProjectPlane /// /// /// - public bool LoadData(string filename) + public void LoadData(string filename) { if (!File.Exists(filename)) { - return false; + throw new Exception("File not found"); } string bufferTextFromFile = ""; using (FileStream fs = new(filename, FileMode.Open)) @@ -125,7 +124,7 @@ namespace ProjectPlane if (!curLine.Contains("MapsCollection")) { - return false; + throw new Exception("Incorrect format"); } _mapStorages.Clear();