SessionZero.SzfToolkit-Dotnet/SessionZero.SzfLib/SzfObjectAttribute.cs

21 lines
755 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 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;
}
}