Files
tbd-station-14/Content.Server/GameObjects/EntitySystems/DoorSystem.cs
Visne 318f051fb9 Allow all door access in Suspicion mode (#1817)
* Add AccessTypes, let RuleSuspicion change it

* Fix enum description

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Move check to CanOpen()

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
2020-08-25 13:37:21 +02:00

52 lines
1.5 KiB
C#

using Content.Server.GameObjects.Components.Doors;
using JetBrains.Annotations;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
{
[UsedImplicitly]
class DoorSystem : EntitySystem
{
/// <summary>
/// Determines the base access behavior of all doors on the station.
/// </summary>
public AccessTypes AccessType { get; set; }
/// <summary>
/// How door access should be handled.
/// </summary>
public enum AccessTypes
{
/// <summary> ID based door access. </summary>
Id,
/// <summary>
/// Allows everyone to open doors, except external which airlocks are still handled with ID's
/// </summary>
AllowAllIdExternal,
/// <summary>
/// Allows everyone to open doors, except external airlocks which are never allowed, even if the user has
/// ID access.
/// </summary>
AllowAllNoExternal,
/// <summary> Allows everyone to open all doors. </summary>
AllowAll
}
public override void Initialize()
{
base.Initialize();
AccessType = AccessTypes.Id;
}
/// <inheritdoc />
public override void Update(float frameTime)
{
foreach (var comp in ComponentManager.EntityQuery<ServerDoorComponent>())
{
comp.OnUpdate(frameTime);
}
}
}
}