Class SharedToolSystem
Implements
Namespace: Content.Shared.Tools
Assembly: Content.Shared.dll
Syntax
public abstract class SharedToolSystem : EntitySystem, EntitySystem
Methods
| Improve this Doc View SourceCycleMultipleTool(EntityUid, MultipleToolComponent, Nullable<EntityUid>)
Declaration
public bool CycleMultipleTool(EntityUid uid, MultipleToolComponent multiple = null, EntityUid? user = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
MultipleToolComponent | multiple | |
System.Nullable<EntityUid> | user |
Returns
Type | Description |
---|---|
System.Boolean |
HasAllQualities(EntityUid, IEnumerable<String>, ToolComponent)
Whether a tool entity has all specified qualities or not.
Declaration
public bool HasAllQualities(EntityUid uid, IEnumerable<string> qualities, ToolComponent tool = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
IEnumerable<System.String> | qualities | |
ToolComponent | tool |
Returns
Type | Description |
---|---|
System.Boolean |
HasQuality(EntityUid, String, ToolComponent)
Whether a tool entity has the specified quality or not.
Declaration
public bool HasQuality(EntityUid uid, string quality, ToolComponent tool = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
System.String | quality | |
ToolComponent | tool |
Returns
Type | Description |
---|---|
System.Boolean |
Initialize()
Declaration
public override void Initialize()
InitializeMultipleTool()
Declaration
public void InitializeMultipleTool()
IsWelder(EntityUid)
Declaration
protected abstract bool IsWelder(EntityUid uid)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid |
Returns
Type | Description |
---|---|
System.Boolean |
PlayToolSound(EntityUid, ToolComponent, Nullable<EntityUid>)
Declaration
public void PlayToolSound(EntityUid uid, ToolComponent tool, EntityUid? user)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
ToolComponent | tool | |
System.Nullable<EntityUid> | user |
SetMultipleTool(EntityUid, MultipleToolComponent, ToolComponent, Boolean, Nullable<EntityUid>)
Declaration
public virtual void SetMultipleTool(EntityUid uid, MultipleToolComponent multiple = null, ToolComponent tool = null, bool playSound = false, EntityUid? user = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
MultipleToolComponent | multiple | |
ToolComponent | tool | |
System.Boolean | playSound | |
System.Nullable<EntityUid> | user |
UseTool(EntityUid, EntityUid, Nullable<EntityUid>, Single, IEnumerable<String>, DoAfterEvent, ToolComponent)
Attempts to use a tool on some entity, which will start a DoAfter. Returns true if an interaction occurred. Note that this does not mean the interaction was successful, you need to listen for the DoAfter event.
Declaration
public bool UseTool(EntityUid tool, EntityUid user, EntityUid? target, float doAfterDelay, IEnumerable<string> toolQualitiesNeeded, DoAfterEvent doAfterEv, ToolComponent toolComponent = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | tool | The tool to use |
EntityUid | user | The entity using the tool |
System.Nullable<EntityUid> | target | The entity that the tool is being used on. This is also the entity that will receive the event. If null, the event will be broadcast |
System.Single | doAfterDelay | The base tool use delay (seconds). This will be modified by the tool's quality |
IEnumerable<System.String> | toolQualitiesNeeded | The qualities needed for this tool to work. |
DoAfterEvent | doAfterEv | The event that will be raised when the tool has finished (including cancellation). Event will be directed at the tool target. |
ToolComponent | toolComponent | The tool component. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if any interaction takes place. |
UseTool(EntityUid, EntityUid, Nullable<EntityUid>, Single, String, DoAfterEvent, ToolComponent)
Attempts to use a tool on some entity, which will start a DoAfter. Returns true if an interaction occurred. Note that this does not mean the interaction was successful, you need to listen for the DoAfter event.
Declaration
public bool UseTool(EntityUid tool, EntityUid user, EntityUid? target, float doAfterDelay, string toolQualityNeeded, DoAfterEvent doAfterEv, ToolComponent toolComponent = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | tool | The tool to use |
EntityUid | user | The entity using the tool |
System.Nullable<EntityUid> | target | The entity that the tool is being used on. This is also the entity that will receive the event. If null, the event will be broadcast |
System.Single | doAfterDelay | The base tool use delay (seconds). This will be modified by the tool's quality |
System.String | toolQualityNeeded | The quality needed for this tool to work. |
DoAfterEvent | doAfterEv | The event that will be raised when the tool has finished (including cancellation). Event will be directed at the tool target. |
ToolComponent | toolComponent | The tool component. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if any interaction takes place. |
UseTool(EntityUid, EntityUid, Nullable<EntityUid>, TimeSpan, IEnumerable<String>, DoAfterEvent, out Nullable<DoAfterId>, ToolComponent)
Attempts to use a tool on some entity, which will start a DoAfter. Returns true if an interaction occurred. Note that this does not mean the interaction was successful, you need to listen for the DoAfter event.
Declaration
public bool UseTool(EntityUid tool, EntityUid user, EntityUid? target, TimeSpan delay, IEnumerable<string> toolQualitiesNeeded, DoAfterEvent doAfterEv, out DoAfterId? id, ToolComponent toolComponent = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | tool | The tool to use |
EntityUid | user | The entity using the tool |
System.Nullable<EntityUid> | target | The entity that the tool is being used on. This is also the entity that will receive the event. If null, the event will be broadcast |
TimeSpan | delay | The base tool use delay. This will be modified by the tool's quality |
IEnumerable<System.String> | toolQualitiesNeeded | The qualities needed for this tool to work. |
DoAfterEvent | doAfterEv | The event that will be raised when the tool has finished (including cancellation). Event will be directed at the tool target. |
System.Nullable<Content.Shared.DoAfter.DoAfterId> | id | The id of the DoAfter that was created. This may be null even if the function returns true in the event that this tool-use cancelled an existing DoAfter |
ToolComponent | toolComponent | The tool component. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if any interaction takes place. |