Class LockSystem
Handles (un)locking and examining of Lock components
Inheritance
System.Object
LockSystem
Namespace: Content.Shared.Lock
Assembly: Content.Shared.dll
Syntax
public sealed class LockSystem : EntitySystem
Methods
| Improve this Doc View SourceCanToggleLock(EntityUid, EntityUid, Boolean)
Raises an event for other components to check whether or not the entity can be locked in its current state.
Declaration
public bool CanToggleLock(EntityUid uid, EntityUid user, bool quiet = true)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
EntityUid | user | |
System.Boolean | quiet |
Returns
Type | Description |
---|---|
System.Boolean |
Initialize()
Declaration
public override void Initialize()
TryLock(EntityUid, EntityUid, LockComponent)
Attmempts to lock a given entity
Declaration
public bool TryLock(EntityUid uid, EntityUid user, LockComponent lockComp = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The entity with the lock |
EntityUid | user | The person trying to lock it |
LockComponent | lockComp |
Returns
Type | Description |
---|---|
System.Boolean | If locking was successful |
TryUnlock(EntityUid, EntityUid, LockComponent)
Attmempts to unlock a given entity
Declaration
public bool TryUnlock(EntityUid uid, EntityUid user, LockComponent lockComp = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The entity with the lock |
EntityUid | user | The person trying to unlock it |
LockComponent | lockComp |
Returns
Type | Description |
---|---|
System.Boolean | If locking was successful |
Unlock(EntityUid, Nullable<EntityUid>, LockComponent)
Forces a given entity to be unlocked
Declaration
public void Unlock(EntityUid uid, EntityUid? user, LockComponent lockComp = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The entity with the lock |
System.Nullable<EntityUid> | user | The person unlocking it. Can be null |
LockComponent | lockComp |