ActionBlockerSystem now has EntityUid overloads.
This commit is contained in:
@@ -20,6 +20,9 @@ namespace Content.Shared.ActionBlocker
|
|||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public class ActionBlockerSystem : EntitySystem
|
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(IEntity entity)
|
public bool CanMove(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new MovementAttemptEvent(entity);
|
var ev = new MovementAttemptEvent(entity);
|
||||||
@@ -28,6 +31,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanMove(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanMove(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanInteract(IEntity entity)
|
public bool CanInteract(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new InteractionAttemptEvent(entity);
|
var ev = new InteractionAttemptEvent(entity);
|
||||||
@@ -46,6 +54,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanInteract(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanInteract(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanUse(IEntity entity)
|
public bool CanUse(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new UseAttemptEvent(entity);
|
var ev = new UseAttemptEvent(entity);
|
||||||
@@ -64,6 +77,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanUse(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanUse(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanThrow(IEntity entity)
|
public bool CanThrow(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new ThrowAttemptEvent(entity);
|
var ev = new ThrowAttemptEvent(entity);
|
||||||
@@ -82,6 +100,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanThrow(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanThrow(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanSpeak(IEntity entity)
|
public bool CanSpeak(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new SpeakAttemptEvent(entity);
|
var ev = new SpeakAttemptEvent(entity);
|
||||||
@@ -100,6 +123,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanSpeak(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanSpeak(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanDrop(IEntity entity)
|
public bool CanDrop(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new DropAttemptEvent(entity);
|
var ev = new DropAttemptEvent(entity);
|
||||||
@@ -118,6 +146,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanDrop(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanDrop(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanPickup(IEntity entity)
|
public bool CanPickup(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new PickupAttemptEvent(entity);
|
var ev = new PickupAttemptEvent(entity);
|
||||||
@@ -136,6 +169,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanPickup(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanPickup(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanEmote(IEntity entity)
|
public bool CanEmote(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new EmoteAttemptEvent(entity);
|
var ev = new EmoteAttemptEvent(entity);
|
||||||
@@ -154,6 +192,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanEmote(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanEmote(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanAttack(IEntity entity)
|
public bool CanAttack(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new AttackAttemptEvent(entity);
|
var ev = new AttackAttemptEvent(entity);
|
||||||
@@ -172,6 +215,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanAttack(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanAttack(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanEquip(IEntity entity)
|
public bool CanEquip(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new EquipAttemptEvent(entity);
|
var ev = new EquipAttemptEvent(entity);
|
||||||
@@ -190,6 +238,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanEquip(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanEquip(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanUnequip(IEntity entity)
|
public bool CanUnequip(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new UnequipAttemptEvent(entity);
|
var ev = new UnequipAttemptEvent(entity);
|
||||||
@@ -208,6 +261,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanUnequip(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanUnequip(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanChangeDirection(IEntity entity)
|
public bool CanChangeDirection(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new ChangeDirectionAttemptEvent(entity);
|
var ev = new ChangeDirectionAttemptEvent(entity);
|
||||||
@@ -226,6 +284,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanChangeDirection(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanChangeDirection(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanShiver(IEntity entity)
|
public bool CanShiver(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new ShiverAttemptEvent(entity);
|
var ev = new ShiverAttemptEvent(entity);
|
||||||
@@ -242,6 +305,11 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanShiver(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanShiver(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
|
|
||||||
public bool CanSweat(IEntity entity)
|
public bool CanSweat(IEntity entity)
|
||||||
{
|
{
|
||||||
var ev = new SweatAttemptEvent(entity);
|
var ev = new SweatAttemptEvent(entity);
|
||||||
@@ -259,5 +327,10 @@ namespace Content.Shared.ActionBlocker
|
|||||||
|
|
||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanSweat(EntityUid uid)
|
||||||
|
{
|
||||||
|
return CanSweat(EntityManager.GetEntity(uid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ namespace Content.Shared.EffectBlocker
|
|||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public class EffectBlockerSystem : EntitySystem
|
public class EffectBlockerSystem : EntitySystem
|
||||||
{
|
{
|
||||||
|
// TODO: Make these methods not static. Maybe move them to their relevant EntitySystems?
|
||||||
|
// TODO: Add EntityUid overloads.
|
||||||
|
|
||||||
public static bool CanFall(IEntity entity)
|
public static bool CanFall(IEntity entity)
|
||||||
{
|
{
|
||||||
var canFall = true;
|
var canFall = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user