2020-08-13 14:40:27 +02:00
|
|
|
|
using Content.Server.GameObjects.Components.Doors;
|
2020-08-25 13:37:21 +02:00
|
|
|
|
using JetBrains.Annotations;
|
2020-08-13 14:40:27 +02:00
|
|
|
|
using Robust.Shared.GameObjects.Systems;
|
2018-07-26 14:26:19 -07:00
|
|
|
|
|
2020-07-29 15:49:44 -07:00
|
|
|
|
namespace Content.Server.GameObjects.EntitySystems
|
2018-07-26 14:26:19 -07:00
|
|
|
|
{
|
2020-08-25 13:37:21 +02:00
|
|
|
|
[UsedImplicitly]
|
2018-07-26 14:26:19 -07:00
|
|
|
|
class DoorSystem : EntitySystem
|
|
|
|
|
|
{
|
2020-08-25 13:37:21 +02:00
|
|
|
|
/// <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;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-07-29 15:49:44 -07:00
|
|
|
|
/// <inheritdoc />
|
2018-07-26 14:26:19 -07:00
|
|
|
|
public override void Update(float frameTime)
|
|
|
|
|
|
{
|
2020-07-29 15:49:44 -07:00
|
|
|
|
foreach (var comp in ComponentManager.EntityQuery<ServerDoorComponent>())
|
2018-07-26 14:26:19 -07:00
|
|
|
|
{
|
|
|
|
|
|
comp.OnUpdate(frameTime);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|