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