2021-12-26 17:07:28 +13:00
|
|
|
using Content.Shared.Access.Components;
|
2021-10-22 05:31:07 +03:00
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
2021-12-26 17:07:28 +13:00
|
|
|
namespace Content.Shared.Access.Systems
|
2021-10-22 05:31:07 +03:00
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|