SessionZero.SzfToolkit-Dotnet/SessionZero.SzfLib/SzfObjectAttribute.cs
2025-07-15 20:29:24 -05:00

21 lines
764 B
C#

namespace SessionZero.SzfLib;
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public class SzfObjectAttribute : Attribute
{
/// <summary>
/// The unique identifier for the SzfObject type (e.g., "dataset", "character_template", "character").
/// This is used in the `!tpye` header of the SZF file to identify the type of SzfObject.
/// </summary>
public required string TypeIdentifier { get; set; }
public SzfObjectAttribute(string typeIdentifier)
{
if (string.IsNullOrWhiteSpace(typeIdentifier))
{
throw new ArgumentException("Type identifier cannot be null or whitespace.", nameof(typeIdentifier));
}
TypeIdentifier = typeIdentifier;
}
}