Converted everything to use collision and physics component interfaces.

This commit is contained in:
Acruid
2020-07-19 00:33:02 -07:00
parent ea94f4a182
commit c9374992a6
29 changed files with 75 additions and 75 deletions

View File

@@ -143,10 +143,10 @@ namespace Content.Shared.GameObjects.Components.Movement
public override void OnAdd()
{
// This component requires that the entity has a PhysicsComponent.
if (!Owner.HasComponent<PhysicsComponent>())
if (!Owner.HasComponent<IPhysicsComponent>())
Logger.Error(
$"[ECS] {Owner.Prototype?.Name} - {nameof(SharedPlayerInputMoverComponent)} requires" +
$" {nameof(PhysicsComponent)}. ");
$" {nameof(IPhysicsComponent)}. ");
base.OnAdd();
}

View File

@@ -54,8 +54,8 @@ namespace Content.Shared.GameObjects.EntitySystems
base.Shutdown();
}
protected void UpdateKinematics(ITransformComponent transform, IMoverComponent mover, PhysicsComponent physics,
CollidableComponent? collider = null)
protected void UpdateKinematics(ITransformComponent transform, IMoverComponent mover, IPhysicsComponent physics,
ICollidableComponent? collider = null)
{
if (physics.Controller == null)
{
@@ -110,10 +110,10 @@ namespace Content.Shared.GameObjects.EntitySystems
}
protected abstract void SetController(PhysicsComponent physics);
protected abstract void SetController(IPhysicsComponent physics);
private bool IsAroundCollider(ITransformComponent transform, IMoverComponent mover,
CollidableComponent collider)
ICollidableComponent collider)
{
foreach (var entity in _entityManager.GetEntitiesInRange(transform.Owner, mover.GrabRange, true))
{
@@ -122,7 +122,7 @@ namespace Content.Shared.GameObjects.EntitySystems
continue; // Don't try to push off of yourself!
}
if (!entity.TryGetComponent<CollidableComponent>(out var otherCollider))
if (!entity.TryGetComponent<ICollidableComponent>(out var otherCollider))
{
continue;
}