Move Access to ECS (#4826)
* Moved access to ecs * Fixed tests * Moved test to integration * Better IoC * Moved preset ID card * Moved id card to ECS * Moved access component to ECS * Fixed pda access * Final touches Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
24
Content.Server/Access/Systems/AccessSystem.cs
Normal file
24
Content.Server/Access/Systems/AccessSystem.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Content.Server.Access.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Content.Server.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user