Don't raise ToolAct, remove unused IToolAct
This commit is contained in:
@@ -48,17 +48,6 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
|
|
||||||
#region Tools
|
#region Tools
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This interface gives components behavior when being clicked on or "attacked" by a user with a tool in their hand
|
|
||||||
/// </summary>
|
|
||||||
public interface IToolAct
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Called when using a tool on an entity
|
|
||||||
/// </summary>
|
|
||||||
bool ToolAct(ToolActEventArgs eventArgs) => false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ToolActEventArgs : EventArgs
|
public class ToolActEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public IEntity User { get; set; }
|
public IEntity User { get; set; }
|
||||||
@@ -71,7 +60,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// This interface gives components behavior when being clicked on or "attacked" by a user with a wrench in their hand
|
/// This interface gives components behavior when being clicked on or "attacked" by a user with a wrench in their hand
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IWrenchAct : IToolAct
|
public interface IWrenchAct
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when using a wrench on an entity
|
/// Called when using a wrench on an entity
|
||||||
@@ -87,7 +76,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// This interface gives components behavior when being clicked on or "attacked" by a user with a crowbar in their hand
|
/// This interface gives components behavior when being clicked on or "attacked" by a user with a crowbar in their hand
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ICrowbarAct : IToolAct
|
public interface ICrowbarAct
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when using a wrench on an entity
|
/// Called when using a wrench on an entity
|
||||||
@@ -694,11 +683,6 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
// We handle specific tools AttackBy here.
|
// We handle specific tools AttackBy here.
|
||||||
if (weapon.TryGetComponent<ToolComponent>(out var tool))
|
if (weapon.TryGetComponent<ToolComponent>(out var tool))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (attacked.GetAllComponents<IToolAct>().Any((act => act.ToolAct(new ToolActEventArgs()
|
|
||||||
{User = user, ClickLocation = clickLocation, AttackWith = weapon}))))
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (tool.Behavior)
|
switch (tool.Behavior)
|
||||||
{
|
{
|
||||||
case Tool.Wrench:
|
case Tool.Wrench:
|
||||||
|
|||||||
Reference in New Issue
Block a user