mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* Initial commit * Fixing merge conflict * Merge conflict fixed * Additional fixes * Reverted change * Serialization fix * Holopad UIs will update when one is deleted or changes map * Minor clean up * Removed obsolete variables * Addressed review comments
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using Robust.Shared.Timing;
|
|
|
|
namespace Content.Shared.Holopad;
|
|
|
|
public abstract partial class SharedHolopadSystem : EntitySystem
|
|
{
|
|
[Dependency] private IGameTiming _timing = default!;
|
|
|
|
public bool IsHolopadControlLocked(Entity<HolopadComponent> entity, EntityUid? user = null)
|
|
{
|
|
if (_timing.CurTime > entity.Comp.ControlLockoutEndTime)
|
|
return false;
|
|
|
|
if (entity.Comp.ControlLockoutOwner == null || entity.Comp.ControlLockoutOwner == user)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
public TimeSpan GetHolopadControlLockedPeriod(Entity<HolopadComponent> entity)
|
|
{
|
|
return entity.Comp.ControlLockoutEndTime - _timing.CurTime;
|
|
}
|
|
|
|
public bool IsHolopadBroadcastOnCoolDown(Entity<HolopadComponent> entity)
|
|
{
|
|
if (_timing.CurTime > entity.Comp.ControlLockoutCoolDownEndTime)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
public TimeSpan GetHolopadBroadcastCoolDown(Entity<HolopadComponent> entity)
|
|
{
|
|
return entity.Comp.ControlLockoutCoolDownEndTime - _timing.CurTime;
|
|
}
|
|
}
|