Deprecate a bunch of IActionBlocker (#4852)
* Deprecate IActionBlocker ChangeDirectionAttempt * Woops * Throw and interact * Deperacte speech * ActionBlocker in fucking shambles * CanEmote go byebye * CanAttack is GONE * IActionBlocker finally ded * DRY
This commit is contained in:
@@ -42,15 +42,6 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
foreach (var blocker in ev.Entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
if (!blocker.CanInteract())
|
||||
{
|
||||
ev.Cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
@@ -65,15 +56,6 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
foreach (var blocker in ev.Entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
if (!blocker.CanUse())
|
||||
{
|
||||
ev.Cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
@@ -88,15 +70,6 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
foreach (var blocker in ev.Entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
if (!blocker.CanThrow())
|
||||
{
|
||||
ev.Cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
@@ -111,15 +84,6 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
foreach (var blocker in ev.Entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
if (!blocker.CanSpeak())
|
||||
{
|
||||
ev.Cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
@@ -134,15 +98,6 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
foreach (var blocker in ev.Entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
if (!blocker.CanDrop())
|
||||
{
|
||||
ev.Cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
@@ -157,15 +112,6 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
foreach (var blocker in ev.Entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
if (!blocker.CanPickup())
|
||||
{
|
||||
ev.Cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
@@ -180,15 +126,6 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
foreach (var blocker in ev.Entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
if (!blocker.CanEmote())
|
||||
{
|
||||
ev.Cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
@@ -203,15 +140,6 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
foreach (var blocker in ev.Entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
if (!blocker.CanAttack())
|
||||
{
|
||||
ev.Cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
@@ -226,15 +154,6 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
foreach (var blocker in ev.Entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
if (!blocker.CanEquip())
|
||||
{
|
||||
ev.Cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
@@ -249,15 +168,6 @@ namespace Content.Shared.ActionBlocker
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
foreach (var blocker in ev.Entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
if (!blocker.CanUnequip())
|
||||
{
|
||||
ev.Cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
using System;
|
||||
using Content.Shared.EffectBlocker;
|
||||
|
||||
namespace Content.Shared.ActionBlocker
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface gives components the ability to block certain actions from
|
||||
/// being done by the owning entity. For effects see <see cref="IEffectBlocker"/>
|
||||
/// </summary>
|
||||
[Obsolete("Use events instead")]
|
||||
public interface IActionBlocker
|
||||
{
|
||||
[Obsolete("Use InteractAttemptEvent instead")]
|
||||
bool CanInteract() => true;
|
||||
|
||||
[Obsolete("Use UseAttemptEvent instead")]
|
||||
bool CanUse() => true;
|
||||
|
||||
[Obsolete("Use ThrowAttemptEvent instead")]
|
||||
bool CanThrow() => true;
|
||||
|
||||
[Obsolete("Use SpeakAttemptEvent instead")]
|
||||
bool CanSpeak() => true;
|
||||
|
||||
[Obsolete("Use DropAttemptEvent instead")]
|
||||
bool CanDrop() => true;
|
||||
|
||||
[Obsolete("Use PickupAttemptEvent instead")]
|
||||
bool CanPickup() => true;
|
||||
|
||||
[Obsolete("Use EmoteAttemptEvent instead")]
|
||||
bool CanEmote() => true;
|
||||
|
||||
[Obsolete("Use AttackAttemptEvent instead")]
|
||||
bool CanAttack() => true;
|
||||
|
||||
[Obsolete("Use EquipAttemptEvent instead")]
|
||||
bool CanEquip() => true;
|
||||
|
||||
[Obsolete("Use UnequipAttemptEvent instead")]
|
||||
bool CanUnequip() => true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user