Machine is now propertyful

This commit is contained in:
Matt Nadareski
2026-04-04 16:06:07 -04:00
parent b8d4adf0e7
commit 7a9f5d1fa1
18 changed files with 536 additions and 218 deletions

View File

@@ -63,7 +63,7 @@ namespace SabreTools.Serialization.CrossModel
CloneOf = parent.CloneOf,
Year = parent.Year,
Manufacturer = parent.Manufacturer,
Category = parent.ReadString(Data.Models.Metadata.Machine.CategoryKey),
Category = parent.Category is null ? null : string.Join(", ", parent.Category),
Players = parent.Players,
Rotation = parent.Rotation,
Control = parent.Control,

View File

@@ -52,7 +52,7 @@ namespace SabreTools.Serialization.CrossModel
CloneOf = item.CloneOf,
Year = item.Year,
Manufacturer = item.Manufacturer,
[Data.Models.Metadata.Machine.CategoryKey] = item.Category,
Category = item.Category is null ? null : [item.Category],
Players = item.Players,
Rotation = item.Rotation,
Control = item.Control,

View File

@@ -74,7 +74,7 @@ namespace SabreTools.Serialization.CrossModel
// gameBase.DriverStatus = item.ReadString(Data.Models.Metadata.Machine.DriverKey); // TODO: Needs metadata mapping
gameBase.Year = item.Year;
gameBase.Manufacturer = item.Manufacturer;
gameBase.Category = item.ReadString(Data.Models.Metadata.Machine.CategoryKey);
gameBase.Category = item.Category is null ? null : string.Join(", ", item.Category);
gameBase.CloneOf = item.CloneOf;
gameBase.RomOf = item.RomOf;
gameBase.SampleOf = item.SampleOf;

View File

@@ -69,7 +69,7 @@ namespace SabreTools.Serialization.CrossModel
// Driver = item.DriverStatus, // TODO: Needs metadata mapping
Year = item.Year,
Manufacturer = item.Manufacturer,
[Data.Models.Metadata.Machine.CategoryKey] = item.Category,
Category = item.Category is null ? null : [item.Category],
CloneOf = item.CloneOf,
RomOf = item.RomOf,
SampleOf = item.SampleOf,

View File

@@ -122,12 +122,12 @@ namespace SabreTools.Serialization.CrossModel
gameBase.Id = item.Id;
gameBase.CloneOfId = item.CloneOfId;
gameBase.Runnable = item.Runnable;
gameBase.Comment = item.ReadStringArray(Data.Models.Metadata.Machine.CommentKey);
gameBase.Comment = item.Comment;
gameBase.Description = item.Description;
gameBase.Year = item.Year;
gameBase.Manufacturer = item.Manufacturer;
gameBase.Publisher = item.Publisher;
gameBase.Category = item.ReadStringArray(Data.Models.Metadata.Machine.CategoryKey);
gameBase.Category = item.Category;
if (item.TitleID is not null
|| item.Developer is not null

View File

@@ -127,10 +127,10 @@ namespace SabreTools.Serialization.CrossModel
var machine = new Data.Models.Metadata.Machine
{
Board = item.Board,
[Data.Models.Metadata.Machine.CategoryKey] = item.Category,
Category = item.Category,
CloneOf = item.CloneOf ?? item.Trurip?.CloneOf,
CloneOfId = item.CloneOfId,
[Data.Models.Metadata.Machine.CommentKey] = item.Comment,
Comment = item.Comment,
CRC = item.Trurip?.CRC,
Description = item.Description,
Developer = item.Trurip?.Developer,

View File

@@ -92,7 +92,7 @@ namespace SabreTools.Serialization.CrossModel
Language = item.Language,
Im1CRC = item.Im1CRC,
Im2CRC = item.Im2CRC,
Comment = item.ReadString(Data.Models.Metadata.Machine.CommentKey),
Comment = item.Comment is null ? null : string.Join(", ", item.Comment),
DuplicateID = item.DuplicateID,
};

View File

@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.CrossModel
Language = item.Language,
Im1CRC = item.Im1CRC,
Im2CRC = item.Im2CRC,
[Data.Models.Metadata.Machine.CommentKey] = item.Comment,
Comment = item.Comment is null ? null : [item.Comment],
DuplicateID = item.DuplicateID,
};