AccessLevelPrototype.cs 970 B

1234567891011121314151617181920212223242526272829303132333435
  1. using Robust.Shared.Prototypes;
  2. namespace Content.Shared.Access
  3. {
  4. /// <summary>
  5. /// Defines a single access level that can be stored on ID cards and checked for.
  6. /// </summary>
  7. [Prototype]
  8. public sealed partial class AccessLevelPrototype : IPrototype
  9. {
  10. [ViewVariables]
  11. [IdDataField]
  12. public string ID { get; private set; } = default!;
  13. /// <summary>
  14. /// The player-visible name of the access level, in the ID card console and such.
  15. /// </summary>
  16. [DataField]
  17. public string? Name { get; set; }
  18. /// <summary>
  19. /// Denotes whether this access level is intended to be assignable to a crew ID card.
  20. /// </summary>
  21. [DataField]
  22. public bool CanAddToIdCard = true;
  23. public string GetAccessLevelName()
  24. {
  25. if (Name is { } name)
  26. return Loc.GetString(name);
  27. return ID;
  28. }
  29. }
  30. }