using System;
namespace Robust.Shared.Serialization
{
///
/// Attribute for marking an enum type as being the constant representation for a field.
///
/// Some fields are arbitrary ints, but it's helpful for readability to have them be
/// named constants instead. This allows for that.
///
/// NB: AllowMultiple is true - don't assume the same representation cannot
/// be reused between multiple fields.
///
[AttributeUsage(AttributeTargets.Enum, AllowMultiple = true, Inherited = false)]
public class ConstantsForAttribute : Attribute
{
private readonly Type _tag;
public Type Tag => _tag;
// NB: This is not generic because C# does not allow generic attributes
///
/// An attribute with tag type
///
///
/// An arbitrary tag type used for coordinating between the data field and the
/// representation. Not actually used for serialization/deserialization.
///
public ConstantsForAttribute(Type tag)
{
_tag = tag;
}
}
}