Dispose of Region-filestream
This commit is contained in:
@ -59,16 +59,4 @@ public class Region
|
||||
else return null;
|
||||
}
|
||||
|
||||
public static Region? FromFile(string filePath)
|
||||
{
|
||||
if (File.Exists(filePath))
|
||||
return JsonSerializer.Deserialize<Region>(new FileStream(filePath, FileMode.Open), serializerOptions)!;
|
||||
else return null;
|
||||
}
|
||||
|
||||
public static Region? FromId(string path, ulong regionId)
|
||||
{
|
||||
string filePath = Path.Join(path, $"{regionId}.region");
|
||||
return FromFile(filePath);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user