mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-10 02:41:18 +03:00
* redundant members * catch IonLawSystem instances * return the ion law sawmill, fix LogMan instances * SalvageSystem LogManager inst * IonLawSystem: public Sawmill * what even is initialization order?
48 lines
1.7 KiB
C#
48 lines
1.7 KiB
C#
using Content.Shared.Access.Components;
|
|
using Content.Shared.Containers.ItemSlots;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Access.Systems
|
|
{
|
|
[UsedImplicitly]
|
|
public abstract partial class SharedIdCardConsoleSystem : EntitySystem
|
|
{
|
|
[Dependency] private ItemSlotsSystem _itemSlotsSystem = default!;
|
|
|
|
public const string Sawmill = "idconsole";
|
|
protected ISawmill _sawmill = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
_sawmill = LogManager.GetSawmill(Sawmill);
|
|
|
|
SubscribeLocalEvent<IdCardConsoleComponent, ComponentInit>(OnComponentInit);
|
|
SubscribeLocalEvent<IdCardConsoleComponent, ComponentRemove>(OnComponentRemove);
|
|
}
|
|
|
|
private void OnComponentInit(EntityUid uid, IdCardConsoleComponent component, ComponentInit args)
|
|
{
|
|
_itemSlotsSystem.AddItemSlot(uid, IdCardConsoleComponent.PrivilegedIdCardSlotId, component.PrivilegedIdSlot);
|
|
_itemSlotsSystem.AddItemSlot(uid, IdCardConsoleComponent.TargetIdCardSlotId, component.TargetIdSlot);
|
|
}
|
|
|
|
private void OnComponentRemove(EntityUid uid, IdCardConsoleComponent component, ComponentRemove args)
|
|
{
|
|
_itemSlotsSystem.RemoveItemSlot(uid, component.PrivilegedIdSlot);
|
|
_itemSlotsSystem.RemoveItemSlot(uid, component.TargetIdSlot);
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
private sealed class IdCardConsoleComponentState : ComponentState
|
|
{
|
|
public List<string> AccessLevels;
|
|
|
|
public IdCardConsoleComponentState(List<string> accessLevels)
|
|
{
|
|
AccessLevels = accessLevels;
|
|
}
|
|
}
|
|
}
|
|
}
|