1
0

NodeGroupAttribute.cs 784 B

123456789101112131415161718192021
  1. using JetBrains.Annotations;
  2. namespace Content.Server.NodeContainer.NodeGroups
  3. {
  4. /// <summary>
  5. /// Associates a <see cref="INodeGroup"/> implementation with a <see cref="NodeGroupID"/>.
  6. /// This is used to gurantee all <see cref="INode"/>s of the same <see cref="NodeGroupID"/>
  7. /// have the same type of <see cref="INodeGroup"/>. Used by <see cref="INodeGroupFactory"/>.
  8. /// </summary>
  9. [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
  10. [MeansImplicitUse]
  11. public sealed class NodeGroupAttribute : Attribute
  12. {
  13. public NodeGroupID[] NodeGroupIDs { get; }
  14. public NodeGroupAttribute(params NodeGroupID[] nodeGroupTypes)
  15. {
  16. NodeGroupIDs = nodeGroupTypes;
  17. }
  18. }
  19. }