mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-05 22:01:33 +00:00
This change looks dramatic, but it's just separating out the already-split namespaces into separate top-level folders. In theory, every single one could be built into their own Nuget package. `SabreTools.Serialization` still builds the normal Nuget package that is used by all other projects and includes all namespaces.
34 lines
885 B
C#
34 lines
885 B
C#
using System.Text;
|
|
|
|
namespace SabreTools.Serialization.Writers
|
|
{
|
|
public partial class XMID : IStringWriter<Data.Models.Xbox.XMID>
|
|
{
|
|
/// <inheritdoc/>
|
|
public bool Debug { get; set; } = false;
|
|
|
|
/// <inheritdoc cref="IStringWriter.Serialize(T?)"/>
|
|
public static string? SerializeString(Data.Models.Xbox.XMID? obj)
|
|
{
|
|
var deserializer = new XMID();
|
|
return deserializer.Serialize(obj);
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public string? Serialize(Data.Models.Xbox.XMID? obj)
|
|
{
|
|
if (obj is null)
|
|
return null;
|
|
|
|
var sb = new StringBuilder();
|
|
|
|
sb.Append(obj.PublisherIdentifier);
|
|
sb.Append(obj.GameID);
|
|
sb.Append(obj.VersionNumber);
|
|
sb.Append(obj.RegionIdentifier);
|
|
|
|
return sb.ToString();
|
|
}
|
|
}
|
|
}
|