mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Catch a few that were missed
This commit is contained in:
@@ -42,8 +42,8 @@ namespace SabreTools.Serialization
|
||||
string lastTopLevel = reader.TopLevel;
|
||||
|
||||
Game? game = null;
|
||||
var games = new List<Game?>();
|
||||
var files = new List<Models.DosCenter.File?>();
|
||||
var games = new List<Game>();
|
||||
var files = new List<Models.DosCenter.File>();
|
||||
|
||||
var additional = new List<string>();
|
||||
var headerAdditional = new List<string>();
|
||||
@@ -65,13 +65,18 @@ namespace SabreTools.Serialization
|
||||
switch (lastTopLevel)
|
||||
{
|
||||
case "doscenter":
|
||||
if (dat.DosCenter != null)
|
||||
dat.DosCenter.ADDITIONAL_ELEMENTS = headerAdditional.ToArray();
|
||||
|
||||
headerAdditional.Clear();
|
||||
break;
|
||||
case "game":
|
||||
if (game != null)
|
||||
{
|
||||
game.File = files.ToArray();
|
||||
game.ADDITIONAL_ELEMENTS = gameAdditional.ToArray();
|
||||
games.Add(game);
|
||||
}
|
||||
|
||||
game = null;
|
||||
files.Clear();
|
||||
|
||||
@@ -39,8 +39,8 @@ namespace SabreTools.Serialization
|
||||
var dat = new MetadataFile();
|
||||
|
||||
Set? set = null;
|
||||
var sets = new List<Set?>();
|
||||
var rows = new List<Row?>();
|
||||
var sets = new List<Set>();
|
||||
var rows = new List<Row>();
|
||||
|
||||
var additional = new List<string>();
|
||||
while (!reader.EndOfStream)
|
||||
@@ -93,19 +93,21 @@ namespace SabreTools.Serialization
|
||||
}
|
||||
|
||||
// Split the line for the name iteratively
|
||||
string[]? lineParts = line?.Split(" ", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
if (lineParts?.Length == 1)
|
||||
lineParts = line?.Split(" ", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
if (lineParts?.Length == 1)
|
||||
lineParts = line?.Split(" ", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
if (lineParts?.Length == 1)
|
||||
lineParts = line?.Split(" ", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
string[] lineParts = line.Split(" ", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
if (lineParts.Length == 1)
|
||||
lineParts = line.Split(" ", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
if (lineParts.Length == 1)
|
||||
lineParts = line.Split(" ", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
if (lineParts.Length == 1)
|
||||
lineParts = line.Split(" ", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
|
||||
// Read the name and set the rest of the line for processing
|
||||
string name = lineParts[0];
|
||||
string trimmedLine = line[name.Length..];
|
||||
if (trimmedLine == null)
|
||||
continue;
|
||||
|
||||
lineParts = trimmedLine?.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
lineParts = trimmedLine.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
|
||||
// The number of items in the row explains what type of row it is
|
||||
var row = new Row();
|
||||
|
||||
@@ -47,9 +47,6 @@ namespace SabreTools.Serialization
|
||||
/// </summary>
|
||||
private static Header ConvertHeaderFromInternalModel(Models.Internal.Header item)
|
||||
{
|
||||
if (item == null)
|
||||
return null;
|
||||
|
||||
var header = new Header
|
||||
{
|
||||
Id = item.ReadString(Models.Internal.Header.IdKey),
|
||||
@@ -334,9 +331,6 @@ namespace SabreTools.Serialization
|
||||
/// </summary>
|
||||
private static Rom ConvertFromInternalModel(Models.Internal.Rom item)
|
||||
{
|
||||
if (item == null)
|
||||
return null;
|
||||
|
||||
var rom = new Rom
|
||||
{
|
||||
Name = item.ReadString(Models.Internal.Rom.NameKey),
|
||||
|
||||
Reference in New Issue
Block a user