Files
tbd-station-14/Content.Shared/Access/Systems/AccessSystem.cs
Leon Friedrich b675bdb789 Move Access & AccessReader to shared. (#5798)
* git mv

* Move Access Component & system.

- Name space changes
- Rename AccessReader to AccessReaderComponent
- Also need an abstract TryGetSlot function for SharedInventoryComponent

* better TryGetSlot

* Ah yes, tests exist.
2021-12-25 20:07:28 -08:00

25 lines
699 B
C#

using Content.Shared.Access.Components;
using Robust.Shared.GameObjects;
using System.Collections.Generic;
namespace Content.Shared.Access.Systems
{
public class AccessSystem : EntitySystem
{
/// <summary>
/// Replaces the set of access tags we have with the provided set.
/// </summary>
/// <param name="newTags">The new access tags</param>
public bool TrySetTags(EntityUid uid, IEnumerable<string> newTags, AccessComponent? access = null)
{
if (!Resolve(uid, ref access))
return false;
access.Tags.Clear();
access.Tags.UnionWith(newTags);
return true;
}
}
}