ActionBlocker CanInteract uses EntityUid exclusively

ActionBlockerSystem fully uses EntityUid now!
This commit is contained in:
Vera Aguilera Puerto
2021-11-09 14:54:00 +01:00
parent b6337ffe7a
commit 48f8dd2284
44 changed files with 66 additions and 75 deletions

View File

@@ -18,9 +18,6 @@ namespace Content.Shared.ActionBlocker
[UsedImplicitly]
public class ActionBlockerSystem : EntitySystem
{
// TODO: Make the EntityUid the main overload for all these methods.
// TODO: Move each of these to their relevant EntitySystems?
public bool CanMove(EntityUid uid)
{
var ev = new MovementAttemptEvent(uid);
@@ -29,18 +26,12 @@ namespace Content.Shared.ActionBlocker
return !ev.Cancelled;
}
public bool CanInteract(IEntity entity)
{
var ev = new InteractionAttemptEvent(entity);
RaiseLocalEvent(entity.Uid, ev);
return !ev.Cancelled;
}
public bool CanInteract(EntityUid uid)
{
return CanInteract(EntityManager.GetEntity(uid));
var ev = new InteractionAttemptEvent(uid);
RaiseLocalEvent(uid, ev);
return !ev.Cancelled;
}
public bool CanUse(EntityUid uid)