2025-05-26 08:00:50 -05:00
|
|
|
using Content.Shared.Access.Components;
|
2022-02-11 19:01:14 -07:00
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Access;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Contains a list of access tags that are part of this group.
|
|
|
|
|
/// Used by <see cref="AccessComponent"/> to avoid boilerplate.
|
|
|
|
|
/// </summary>
|
2025-03-19 14:30:31 -04:00
|
|
|
[Prototype]
|
2023-11-01 19:56:23 -07:00
|
|
|
public sealed partial class AccessGroupPrototype : IPrototype
|
2022-02-11 19:01:14 -07:00
|
|
|
{
|
2023-01-19 03:56:45 +01:00
|
|
|
[IdDataField]
|
2023-08-22 18:14:33 -07:00
|
|
|
public string ID { get; private set; } = default!;
|
2022-02-11 19:01:14 -07:00
|
|
|
|
2025-05-26 08:00:50 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// The player-visible name of the access level group
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public string? Name { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The access levels associated with this group
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField(required: true)]
|
2024-04-01 09:06:13 +03:00
|
|
|
public HashSet<ProtoId<AccessLevelPrototype>> Tags = default!;
|
2025-05-26 08:00:50 -05:00
|
|
|
|
|
|
|
|
public string GetAccessGroupName()
|
|
|
|
|
{
|
|
|
|
|
if (Name is { } name)
|
|
|
|
|
return Loc.GetString(name);
|
|
|
|
|
|
|
|
|
|
return ID;
|
|
|
|
|
}
|
2022-02-11 19:01:14 -07:00
|
|
|
}
|