Class SharedHandsSystem
Inheritance
System.Object
SharedHandsSystem
Assembly: Content.Shared.dll
Syntax
public abstract class SharedHandsSystem : EntitySystem, EntitySystem
Fields
|
Improve this Doc
View Source
MaxAnimationRange
Maximum pickup distance for which the pickup animation plays.
Declaration
public const float MaxAnimationRange = null
Field Value
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
TransformSystem
Declaration
protected readonly SharedTransformSystem TransformSystem
Field Value
Type |
Description |
SharedTransformSystem |
|
Methods
|
Improve this Doc
View Source
AddHand(EntityUid, String, HandLocation, HandsComponent)
Declaration
public virtual void AddHand(EntityUid uid, string handName, HandLocation handLocation, HandsComponent handsComp = null)
Parameters
|
Improve this Doc
View Source
CanDropHeld(EntityUid, Hand, Boolean)
Checks if the contents of a hand is able to be removed from its container.
Declaration
public bool CanDropHeld(EntityUid uid, Hand hand, bool checkActionBlocker = true)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
Hand |
hand |
|
System.Boolean |
checkActionBlocker |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CanPickupAnyHand(EntityUid, EntityUid, Boolean, HandsComponent, ItemComponent)
Declaration
public bool CanPickupAnyHand(EntityUid uid, EntityUid entity, bool checkActionBlocker = true, HandsComponent handsComp = null, ItemComponent item = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CanPickupToHand(EntityUid, EntityUid, Hand, Boolean, HandsComponent, ItemComponent)
Checks whether a given item will fit into a specific user's hand. Unless otherwise specified, this will also check the general CanPickup action blocker.
Declaration
public bool CanPickupToHand(EntityUid uid, EntityUid entity, Hand hand, bool checkActionBlocker = true, HandsComponent handsComp = null, ItemComponent item = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
DoDrop(EntityUid, Hand, Boolean, HandsComponent)
Removes the contents of a hand from its container. Assumes that the removal is allowed. In general, you should not be calling this directly.
Declaration
public virtual void DoDrop(EntityUid uid, Hand hand, bool doDropInteraction = true, HandsComponent handsComp = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
Hand |
hand |
|
System.Boolean |
doDropInteraction |
|
HandsComponent |
handsComp |
|
|
Improve this Doc
View Source
DoPickup(EntityUid, Hand, EntityUid, HandsComponent)
Puts an entity into the player's hand, assumes that the insertion is allowed. In general, you should not be calling this function directly.
Declaration
public virtual void DoPickup(EntityUid uid, Hand hand, EntityUid entity, HandsComponent hands = null)
Parameters
|
Improve this Doc
View Source
EnumerateHands(EntityUid, HandsComponent)
Enumerate over hands, starting with the currently active hand.
Declaration
public IEnumerable<Hand> EnumerateHands(EntityUid uid, HandsComponent handsComp = null)
Parameters
Returns
Type |
Description |
IEnumerable<Hand> |
|
|
Improve this Doc
View Source
EnumerateHeld(EntityUid, HandsComponent)
Enumerate over held items, starting with the item in the currently active hand (if there is one).
Declaration
public IEnumerable<EntityUid> EnumerateHeld(EntityUid uid, HandsComponent handsComp = null)
Parameters
Returns
Type |
Description |
IEnumerable<EntityUid> |
|
|
Improve this Doc
View Source
HandleEntityInserted(EntityUid, HandsComponent, EntInsertedIntoContainerMessage)
Declaration
protected virtual void HandleEntityInserted(EntityUid uid, HandsComponent hands, EntInsertedIntoContainerMessage args)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
HandsComponent |
hands |
|
Robust.Shared.Containers.EntInsertedIntoContainerMessage |
args |
|
|
Improve this Doc
View Source
HandleEntityRemoved(EntityUid, HandsComponent, EntRemovedFromContainerMessage)
Declaration
protected virtual void HandleEntityRemoved(EntityUid uid, HandsComponent hands, EntRemovedFromContainerMessage args)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
HandsComponent |
hands |
|
Robust.Shared.Containers.EntRemovedFromContainerMessage |
args |
|
|
Improve this Doc
View Source
Initialize()
Declaration
public override void Initialize()
|
Improve this Doc
View Source
IsHolding(EntityUid, Nullable<EntityUid>, out Hand, HandsComponent)
Declaration
public bool IsHolding(EntityUid uid, EntityUid? entity, out Hand inHand, HandsComponent handsComp = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.Nullable<EntityUid> |
entity |
|
Hand |
inHand |
|
HandsComponent |
handsComp |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
PickupOrDrop(Nullable<EntityUid>, EntityUid, Boolean, Boolean, Boolean, HandsComponent, ItemComponent)
Puts an item into any hand, preferring the active hand, or puts it on the floor.
Declaration
public void PickupOrDrop(EntityUid? uid, EntityUid entity, bool checkActionBlocker = true, bool animateUser = false, bool animate = true, HandsComponent handsComp = null, ItemComponent item = null)
Parameters
Type |
Name |
Description |
System.Nullable<EntityUid> |
uid |
|
EntityUid |
entity |
|
System.Boolean |
checkActionBlocker |
|
System.Boolean |
animateUser |
|
System.Boolean |
animate |
|
HandsComponent |
handsComp |
|
ItemComponent |
item |
|
|
Improve this Doc
View Source
RemoveHand(EntityUid, String, HandsComponent)
Declaration
public virtual void RemoveHand(EntityUid uid, string handName, HandsComponent handsComp = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.String |
handName |
|
HandsComponent |
handsComp |
|
|
Improve this Doc
View Source
RemoveHands(EntityUid, HandsComponent)
Gets rid of all the entity's hands.
Declaration
public void RemoveHands(EntityUid uid, HandsComponent handsComp = null)
Parameters
|
Improve this Doc
View Source
SetActiveHand(EntityUid, Hand, HandsComponent)
Set the currently active hand and raise hand (de)selection events directed at the held entities.
Declaration
public bool SetActiveHand(EntityUid uid, Hand hand, HandsComponent handComp = null)
Parameters
Returns
Type |
Description |
System.Boolean |
True if the active hand was set to a NEW value. Setting it to the same value returns false and does
not trigger interactions.
|
|
Improve this Doc
View Source
Shutdown()
Declaration
public override void Shutdown()
|
Improve this Doc
View Source
TryActivateItemInHand(EntityUid, HandsComponent, Nullable<String>)
Declaration
public bool TryActivateItemInHand(EntityUid uid, HandsComponent handsComp = null, string? handName = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
HandsComponent |
handsComp |
|
System.Nullable<System.String> |
handName |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryDrop(EntityUid, Hand, Nullable<EntityCoordinates>, Boolean, Boolean, HandsComponent)
Drops a hands contents at the target location.
Declaration
public bool TryDrop(EntityUid uid, Hand hand, EntityCoordinates? targetDropLocation = null, bool checkActionBlocker = true, bool doDropInteraction = true, HandsComponent handsComp = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
Hand |
hand |
|
System.Nullable<Robust.Shared.Map.EntityCoordinates> |
targetDropLocation |
|
System.Boolean |
checkActionBlocker |
|
System.Boolean |
doDropInteraction |
|
HandsComponent |
handsComp |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryDrop(EntityUid, EntityUid, Nullable<EntityCoordinates>, Boolean, Boolean, HandsComponent)
Drops an item at the target location.
Declaration
public bool TryDrop(EntityUid uid, EntityUid entity, EntityCoordinates? targetDropLocation = null, bool checkActionBlocker = true, bool doDropInteraction = true, HandsComponent handsComp = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
EntityUid |
entity |
|
System.Nullable<Robust.Shared.Map.EntityCoordinates> |
targetDropLocation |
|
System.Boolean |
checkActionBlocker |
|
System.Boolean |
doDropInteraction |
|
HandsComponent |
handsComp |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryDrop(EntityUid, Nullable<EntityCoordinates>, Boolean, Boolean, HandsComponent)
Attempts to drop the item in the currently active hand.
Declaration
public bool TryDrop(EntityUid uid, EntityCoordinates? targetDropLocation = null, bool checkActionBlocker = true, bool doDropInteraction = true, HandsComponent handsComp = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.Nullable<Robust.Shared.Map.EntityCoordinates> |
targetDropLocation |
|
System.Boolean |
checkActionBlocker |
|
System.Boolean |
doDropInteraction |
|
HandsComponent |
handsComp |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryDropIntoContainer(EntityUid, EntityUid, BaseContainer, Boolean, HandsComponent)
Attempts to move a held item from a hand into a container that is not another hand, without dropping it on the floor in-between.
Declaration
public bool TryDropIntoContainer(EntityUid uid, EntityUid entity, BaseContainer targetContainer, bool checkActionBlocker = true, HandsComponent handsComp = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
EntityUid |
entity |
|
Robust.Shared.Containers.BaseContainer |
targetContainer |
|
System.Boolean |
checkActionBlocker |
|
HandsComponent |
handsComp |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryForcePickupAnyHand(EntityUid, EntityUid, Boolean, HandsComponent, ItemComponent)
Tries to pick up an entity into any hand, forcing to drop an item if there are no free hands
By default it does check if it's possible to drop items
Declaration
public bool TryForcePickupAnyHand(EntityUid uid, EntityUid entity, bool checkActionBlocker = true, HandsComponent handsComp = null, ItemComponent item = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryGetEmptyHand(EntityUid, out Hand, HandsComponent)
Get any empty hand. Prioritizes the currently active hand.
Declaration
public bool TryGetEmptyHand(EntityUid uid, out Hand emptyHand, HandsComponent handComp = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryGetHand(EntityUid, String, out Hand, HandsComponent)
Declaration
public bool TryGetHand(EntityUid handsUid, string handId, out Hand hand, HandsComponent hands = null)
Parameters
Type |
Name |
Description |
EntityUid |
handsUid |
|
System.String |
handId |
|
Hand |
hand |
|
HandsComponent |
hands |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryInteractHandWithActiveHand(EntityUid, String, HandsComponent)
Declaration
public bool TryInteractHandWithActiveHand(EntityUid uid, string handName, HandsComponent handsComp = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.String |
handName |
|
HandsComponent |
handsComp |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryMoveHeldEntityToActiveHand(EntityUid, String, Boolean, HandsComponent)
Moves an entity from one hand to the active hand.
Declaration
public bool TryMoveHeldEntityToActiveHand(EntityUid uid, string handName, bool checkActionBlocker = true, HandsComponent handsComp = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.String |
handName |
|
System.Boolean |
checkActionBlocker |
|
HandsComponent |
handsComp |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryPickup(EntityUid, EntityUid, Hand, Boolean, Boolean, HandsComponent, ItemComponent)
Declaration
public bool TryPickup(EntityUid uid, EntityUid entity, Hand hand, bool checkActionBlocker = true, bool animate = true, HandsComponent handsComp = null, ItemComponent item = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
EntityUid |
entity |
|
Hand |
hand |
|
System.Boolean |
checkActionBlocker |
|
System.Boolean |
animate |
|
HandsComponent |
handsComp |
|
ItemComponent |
item |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryPickup(EntityUid, EntityUid, Nullable<String>, Boolean, Boolean, Boolean, HandsComponent, ItemComponent)
Tries to pick up an entity to a specific hand. If no explicit hand is specified, defaults to using the currently active hand.
Declaration
public bool TryPickup(EntityUid uid, EntityUid entity, string? handName = null, bool checkActionBlocker = true, bool animateUser = false, bool animate = true, HandsComponent handsComp = null, ItemComponent item = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
EntityUid |
entity |
|
System.Nullable<System.String> |
handName |
|
System.Boolean |
checkActionBlocker |
|
System.Boolean |
animateUser |
|
System.Boolean |
animate |
|
HandsComponent |
handsComp |
|
ItemComponent |
item |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryPickupAnyHand(EntityUid, EntityUid, Boolean, Boolean, Boolean, HandsComponent, ItemComponent)
Attempts to pick up an item into any empty hand. Prioritizes the currently active hand.
Declaration
public bool TryPickupAnyHand(EntityUid uid, EntityUid entity, bool checkActionBlocker = true, bool animateUser = false, bool animate = true, HandsComponent handsComp = null, ItemComponent item = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
EntityUid |
entity |
|
System.Boolean |
checkActionBlocker |
|
System.Boolean |
animateUser |
|
System.Boolean |
animate |
|
HandsComponent |
handsComp |
|
ItemComponent |
item |
|
Returns
Type |
Description |
System.Boolean |
|
Remarks
|
Improve this Doc
View Source
TrySelect(EntityUid, Nullable<EntityUid>, HandsComponent)
Declaration
public bool TrySelect(EntityUid uid, EntityUid? entity, HandsComponent handsComp = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.Nullable<EntityUid> |
entity |
|
HandsComponent |
handsComp |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TrySelect<TComponent>(EntityUid, out TComponent, HandsComponent)
Declaration
public bool TrySelect<TComponent>(EntityUid uid, out TComponent component, HandsComponent handsComp = null)
where TComponent : Component
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
TComponent |
component |
|
HandsComponent |
handsComp |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
Name |
Description |
TComponent |
|
|
Improve this Doc
View Source
TrySelectEmptyHand(EntityUid, HandsComponent)
Declaration
public bool TrySelectEmptyHand(EntityUid uid, HandsComponent handsComp = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TrySetActiveHand(EntityUid, Nullable<String>, HandsComponent)
Set the currently active hand and raise hand (de)selection events directed at the held entities.
Declaration
public virtual bool TrySetActiveHand(EntityUid uid, string? name, HandsComponent handComp = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.Nullable<System.String> |
name |
|
HandsComponent |
handComp |
|
Returns
Type |
Description |
System.Boolean |
True if the active hand was set to a NEW value. Setting it to the same value returns false and does
not trigger interactions.
|
|
Improve this Doc
View Source
TryUseItemInHand(EntityUid, Boolean, HandsComponent, Nullable<String>)
Declaration
public bool TryUseItemInHand(EntityUid uid, bool altInteract = false, HandsComponent handsComp = null, string? handName = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.Boolean |
altInteract |
|
HandsComponent |
handsComp |
|
System.Nullable<System.String> |
handName |
|
Returns
Type |
Description |
System.Boolean |
|
Events
|
Improve this Doc
View Source
OnHandSetActive
Declaration
protected event Action<HandsComponent>? OnHandSetActive
Event Type
Implements
EntitySystem