GameInfo doesn't crash anymore, but still needs to be improved.

This commit is contained in:
That_One_Nerd 2023-05-12 07:41:48 -04:00
parent be6e4a496b
commit 2abadc4071
3 changed files with 3 additions and 4 deletions

View File

@ -24,7 +24,7 @@ public class Mod
// Root mod directory found, go from here.
FileStream fs = new(gameInfoPath, FileMode.Open);
GameInfo? modInfo = SerializeVkv.Deserialize<GameInfo>(fs); // TODO: constructor should be public i think
GameInfo? modInfo = SerializeVkv.Deserialize<GameInfo>(fs);
if (modInfo is null) continue;
Mod mod = new()

View File

@ -35,7 +35,7 @@ public class GameInfo
public bool SupportsXBox360;
public FileSystemData FileSystem;
internal GameInfo()
public GameInfo()
{
Game = string.Empty;
Title = string.Empty;
@ -60,7 +60,7 @@ public class GameInfo
// Can't make the keys here enums because they can be strung together,
public Dictionary<string, string> SearchPaths;
internal FileSystemData()
public FileSystemData()
{
SearchPaths = new();
}

View File

@ -57,7 +57,6 @@ public static class VkvConvert
{
if (current == "}") break;
VkvNode? output = DeserializeNode(reader, options, out string subName, current);
if (output is null) throw new VkvSerializationException("Error deserializing sub-node.");
tree[subName] = output;
}
if (current is null) throw new VkvSerializationException("Reached end-of-file while deserializing group.");