mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-23 07:14:57 +00:00
Port metadata functionality from ST
This commit is contained in:
41
SabreTools.Metadata.DatItems/Source.cs
Normal file
41
SabreTools.Metadata.DatItems/Source.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
|
||||
#pragma warning disable IDE0290 // Use primary constructor
|
||||
namespace SabreTools.Metadata.DatItems
|
||||
{
|
||||
/// <summary>
|
||||
/// Source information wrapper
|
||||
/// </summary>
|
||||
public class Source : ICloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// Source index
|
||||
/// </summary>
|
||||
public readonly int Index;
|
||||
|
||||
/// <summary>
|
||||
/// Source name
|
||||
/// </summary>
|
||||
public readonly string? Name;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="id">Source ID</param>
|
||||
/// <param name="source">Source name, optional</param>
|
||||
public Source(int id, string? source = null)
|
||||
{
|
||||
Index = id;
|
||||
Name = source;
|
||||
}
|
||||
|
||||
#region Cloning
|
||||
|
||||
/// <summary>
|
||||
/// Clone the current object
|
||||
/// </summary>
|
||||
public object Clone() => new Source(Index, Name);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user