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

@@ -38,7 +38,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
/// </summary>
private bool Connectable => !_deleting && Anchored;
private bool Anchored => !Owner.TryGetComponent<PhysicsComponent>(out var physics) || physics.Anchored;
private bool Anchored => !Owner.TryGetComponent<IPhysicsComponent>(out var physics) || physics.Anchored;
/// <summary>
/// Prevents a node from being used by other nodes while midway through removal.
@@ -60,7 +60,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
{
TryAssignGroupIfNeeded();
CombineGroupWithReachable();
if (Owner.TryGetComponent<PhysicsComponent>(out var physics))
if (Owner.TryGetComponent<IPhysicsComponent>(out var physics))
{
AnchorUpdate();
physics.AnchoredChanged += AnchorUpdate;
@@ -70,9 +70,9 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
public void OnContainerRemove()
{
_deleting = true;
if (Owner.TryGetComponent<PhysicsComponent>(out var physics))
if (Owner.TryGetComponent<IPhysicsComponent>(out var physics))
{
physics.AnchoredChanged -= AnchorUpdate;
((IPhysicsComponent) physics).AnchoredChanged -= AnchorUpdate;
}
NodeGroup.RemoveNode(this);
}