This commit is contained in:
Frozd
2025-11-28 09:52:24 +01:00
parent 7d71783102
commit c7076476f6
11 changed files with 103 additions and 108 deletions

View File

@@ -10,7 +10,7 @@ namespace CarManagerV2
{
internal class SafeManager
{
public static void initializeFile(string path)
public static void InitializeFile(string path)
{
if (!File.Exists(@path))
{
@@ -22,7 +22,7 @@ namespace CarManagerV2
}
}
public static List<Car> readCars(string path)
public static List<Car> ReadCars(string path)
{
List<Car> cars = new List<Car>();
using (StreamReader reader = new StreamReader(@path))
@@ -32,19 +32,19 @@ namespace CarManagerV2
{
// Process the line
if (line == "") continue;
cars.Add(Car.fromCsvString(line));
cars.Add(Car.FromCsvString(line));
}
}
return cars;
}
public static void saveCars(string path, List<Car> cars)
public static void SaveCars(string path, List<Car> cars)
{
using (StreamWriter writer = new StreamWriter(@path))
{
foreach (Car car in cars)
{
writer.WriteLine(car.toCsvString());
writer.WriteLine(car.ToCsvString());
}
}
}