Rename usages of collidable to physics (#2230)

* Rename usages of collidable to physics

* high tier PANIQUE

* aaaaaaaaAAAAAa

* cursed commit dont research

* Fix urist and items being anchored

* Fix the rest
This commit is contained in:
DrSmugleaf
2020-10-11 16:36:58 +02:00
committed by GitHub
parent 413ca9812d
commit b64cb24059
79 changed files with 292 additions and 268 deletions

View File

@@ -55,8 +55,8 @@ namespace Content.Server.GameObjects.Components.Movement
{
base.Initialize();
// This component requires a collidable component.
Owner.EnsureComponent<CollidableComponent>();
// This component requires a physics component.
Owner.EnsureComponent<PhysicsComponent>();
EntitySystem.Get<AiSystem>().ProcessorInitialize(this);
}

View File

@@ -46,9 +46,9 @@ namespace Content.Server.GameObjects.Components.Movement
{
base.Initialize();
if (!Owner.EnsureComponent(out CollidableComponent _))
if (!Owner.EnsureComponent(out PhysicsComponent _))
{
Logger.Warning($"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(CollidableComponent)}");
Logger.Warning($"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(PhysicsComponent)}");
}
_doAfterSystem = EntitySystem.Get<DoAfterSystem>();
@@ -178,7 +178,7 @@ namespace Content.Server.GameObjects.Components.Movement
var result = await _doAfterSystem.DoAfter(doAfterEventArgs);
if (result != DoAfterStatus.Cancelled && entityToMove.TryGetComponent(out ICollidableComponent body) && body.PhysicsShapes.Count >= 1)
if (result != DoAfterStatus.Cancelled && entityToMove.TryGetComponent(out IPhysicsComponent body) && body.PhysicsShapes.Count >= 1)
{
var direction = (Owner.Transform.WorldPosition - entityToMove.Transform.WorldPosition).Normalized;
var endPoint = Owner.Transform.WorldPosition;
@@ -220,7 +220,7 @@ namespace Content.Server.GameObjects.Components.Movement
var result = await _doAfterSystem.DoAfter(doAfterEventArgs);
if (result != DoAfterStatus.Cancelled && user.TryGetComponent(out ICollidableComponent body) && body.PhysicsShapes.Count >= 1)
if (result != DoAfterStatus.Cancelled && user.TryGetComponent(out IPhysicsComponent body) && body.PhysicsShapes.Count >= 1)
{
var direction = (Owner.Transform.WorldPosition - user.Transform.WorldPosition).Normalized;
var endPoint = Owner.Transform.WorldPosition;

View File

@@ -69,15 +69,15 @@ namespace Content.Server.GameObjects.Components.Movement
_entityManager.TryGetEntity(grid.GridEntityId, out var gridEntity))
{
//TODO: Switch to shuttle component
if (!gridEntity.TryGetComponent(out ICollidableComponent? collidable))
if (!gridEntity.TryGetComponent(out IPhysicsComponent? physics))
{
collidable = gridEntity.AddComponent<CollidableComponent>();
collidable.Mass = 1;
collidable.CanCollide = true;
collidable.PhysicsShapes.Add(new PhysShapeGrid(grid));
physics = gridEntity.AddComponent<PhysicsComponent>();
physics.Mass = 1;
physics.CanCollide = true;
physics.PhysicsShapes.Add(new PhysShapeGrid(grid));
}
var controller = collidable.EnsureController<ShuttleController>();
var controller = physics.EnsureController<ShuttleController>();
controller.Push(CalcNewVelocity(direction, enabled), CurrentWalkSpeed);
}
}