Got rid of some IEntities

This commit is contained in:
Wrexbe
2021-12-03 11:15:41 -08:00
parent f5b8bb3731
commit e2d7ea6f62
7 changed files with 81 additions and 83 deletions

View File

@@ -33,7 +33,7 @@ namespace Content.Shared.Buckle.Components
public bool DontCollide { get; set; }
public abstract bool TryBuckle(IEntity? user, IEntity to);
public abstract bool TryBuckle(EntityUid user, EntityUid to);
bool IDraggable.CanDrop(CanDropEvent args)
{
@@ -80,7 +80,7 @@ namespace Content.Shared.Buckle.Components
/// <param name="entity">The entity that had its buckling status changed</param>
/// <param name="strap">The strap that the entity was buckled to or unbuckled from</param>
/// <param name="buckled">True if the entity was buckled, false otherwise</param>
protected BuckleChangeMessage(IEntity entity, IEntity strap, bool buckled)
protected BuckleChangeMessage(EntityUid entity, EntityUid strap, bool buckled)
{
Entity = entity;
Strap = strap;
@@ -90,12 +90,12 @@ namespace Content.Shared.Buckle.Components
/// <summary>
/// The entity that had its buckling status changed
/// </summary>
public IEntity Entity { get; }
public EntityUid Entity { get; }
/// <summary>
/// The strap that the entity was buckled to or unbuckled from
/// </summary>
public IEntity Strap { get; }
public EntityUid Strap { get; }
/// <summary>
/// True if the entity was buckled, false otherwise.
@@ -111,7 +111,7 @@ namespace Content.Shared.Buckle.Components
/// </summary>
/// <param name="entity">The entity that had its buckling status changed</param>
/// <param name="strap">The strap that the entity was buckled to or unbuckled from</param>
public BuckleMessage(IEntity entity, IEntity strap) : base(entity, strap, true)
public BuckleMessage(EntityUid entity, EntityUid strap) : base(entity, strap, true)
{
}
}
@@ -124,7 +124,7 @@ namespace Content.Shared.Buckle.Components
/// </summary>
/// <param name="entity">The entity that had its buckling status changed</param>
/// <param name="strap">The strap that the entity was buckled to or unbuckled from</param>
public UnbuckleMessage(IEntity entity, IEntity strap) : base(entity, strap, false)
public UnbuckleMessage(EntityUid entity, EntityUid strap) : base(entity, strap, false)
{
}
}

View File

@@ -61,19 +61,19 @@ namespace Content.Shared.DragDrop
/// <summary>
/// Entity doing the drag and drop.
/// </summary>
public IEntity User { get; }
public EntityUid User { get; }
/// <summary>
/// Entity that is being dragged.
/// </summary>
public IEntity Dragged { get; }
public EntityUid Dragged { get; }
/// <summary>
/// Creates a new instance of <see cref="StartDragDropEvent"/>.
/// </summary>
/// <param name="user">The entity doing the drag and drop.</param>
/// <param name="dragged">The entity that is being dragged and dropped.</param>
public StartDragDropEvent(IEntity user, IEntity dragged)
public StartDragDropEvent(EntityUid user, EntityUid dragged)
{
User = user;
Dragged = dragged;
@@ -83,10 +83,10 @@ namespace Content.Shared.DragDrop
public class CanDropEvent : StartDragDropEvent
{
/// <summary>
/// The entity that <see cref="StartDragDropEvent.Dragged"/>
/// The entity uid that <see cref="StartDragDropEvent.Dragged"/>
/// is being dropped onto.
/// </summary>
public IEntity Target { get; }
public EntityUid Target { get; }
/// <summary>
/// Creates a new instance of <see cref="CanDropEvent"/>.
@@ -94,7 +94,7 @@ namespace Content.Shared.DragDrop
/// <param name="user">The entity doing the drag and drop.</param>
/// <param name="dragged">The entity that is being dragged and dropped.</param>
/// <param name="target">The entity that <see cref="dropped"/> is being dropped onto.</param>
public CanDropEvent(IEntity user, IEntity dragged, IEntity target) : base(user, dragged)
public CanDropEvent(EntityUid user, EntityUid dragged, EntityUid target) : base(user, dragged)
{
Target = target;
}
@@ -115,7 +115,7 @@ namespace Content.Shared.DragDrop
/// <param name="dropLocation">The location where <see cref="dropped"/> is being dropped.</param>
/// <param name="dragged">The entity that is being dragged and dropped.</param>
/// <param name="target">The entity that <see cref="dropped"/> is being dropped onto.</param>
public DragDropEvent(IEntity user, EntityCoordinates dropLocation, IEntity dragged, IEntity target) : base(user, dragged, target)
public DragDropEvent(EntityUid user, EntityCoordinates dropLocation, EntityUid dragged, EntityUid target) : base(user, dragged, target)
{
DropLocation = dropLocation;
}

View File

@@ -43,7 +43,7 @@ namespace Content.Shared.Interaction
public const float InteractionRange = 2;
public const float InteractionRangeSquared = InteractionRange * InteractionRange;
public delegate bool Ignored(IEntity entity);
public delegate bool Ignored(EntityUid entity);
/// <summary>
/// Traces a ray from coords to otherCoords and returns the length
@@ -94,7 +94,7 @@ namespace Content.Shared.Interaction
{
var predicate = ignoredEnt == null
? null
: (Ignored) (e => e == ignoredEnt);
: (Ignored) (e => e == ignoredEnt?.Uid);
return UnobstructedDistance(origin, other, collisionMask, predicate);
}
@@ -212,7 +212,7 @@ namespace Content.Shared.Interaction
bool ignoreInsideBlocker = false,
bool popup = false)
{
predicate ??= e => e == origin || e == other;
predicate ??= e => e == origin.Uid || e == other.Uid;
return InRangeUnobstructed(origin, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(other).MapPosition, range, collisionMask, predicate, ignoreInsideBlocker, popup);
}
@@ -346,7 +346,7 @@ namespace Content.Shared.Interaction
bool popup = false)
{
var originPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(origin).MapPosition;
predicate ??= e => e == origin;
predicate ??= e => e == origin.Uid;
var inRange = InRangeUnobstructed(originPosition, other, range, collisionMask, predicate, ignoreInsideBlocker);