Acc
This commit is contained in:
36
Content.Shared/Access/AccessLevelPrototype.cs
Normal file
36
Content.Shared/Access/AccessLevelPrototype.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using Robust.Shared.Localization;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
|
using YamlDotNet.RepresentationModel;
|
||||||
|
|
||||||
|
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, IIndexedPrototype
|
||||||
|
{
|
||||||
|
public void LoadFrom(YamlMappingNode mapping)
|
||||||
|
{
|
||||||
|
ID = mapping.GetNode("id").AsString();
|
||||||
|
if (mapping.TryGetNode("name", out var nameNode))
|
||||||
|
{
|
||||||
|
Name = nameNode.AsString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Name = ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
Name = Loc.GetString(Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ID { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The player-visible name of the access level, in the ID card console and such.
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; private set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user