Files
tbd-station-14/Content.Shared/Access/AccessLevelPrototype.cs
2021-03-05 11:13:00 +01:00

32 lines
885 B
C#

#nullable enable
using Robust.Shared.Localization;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Access
{
/// <summary>
/// Defines a single access level that can be stored on ID cards and checked for.
/// </summary>
[Prototype("accessLevel")]
public class AccessLevelPrototype : IPrototype
{
[ViewVariables]
[field: DataField("id", required: true)]
public string ID { get; } = default!;
/// <summary>
/// The player-visible name of the access level, in the ID card console and such.
/// </summary>
[DataField("name")]
public string Name
{
get => _name ?? ID;
private set => _name = Loc.GetString(value);
}
private string? _name;
}
}