Re-organize all projects (#4166)

This commit is contained in:
DrSmugleaf
2021-06-09 22:19:39 +02:00
committed by GitHub
parent 9f50e4061b
commit ff1a2d97ea
1773 changed files with 5258 additions and 5508 deletions

View File

@@ -0,0 +1,34 @@
#nullable enable
using Content.Shared.Roles;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Access.Components
{
[RegisterComponent]
public class PresetIdCardComponent : Component, IMapInit
{
public override string Name => "PresetIdCard";
[DataField("job")]
private string? _jobName;
void IMapInit.MapInit()
{
if (_jobName == null)
{
return;
}
var prototypes = IoCManager.Resolve<IPrototypeManager>();
var job = prototypes.Index<JobPrototype>(_jobName);
var access = Owner.GetComponent<AccessComponent>();
var idCard = Owner.GetComponent<IdCardComponent>();
access.SetTags(job.Access);
idCard.JobTitle = job.Name;
}
}
}