Content changes for engine RotateEvent removal PR (#11448)

This commit is contained in:
Leon Friedrich
2022-09-23 15:57:30 +12:00
committed by GitHub
parent caa5efcd6f
commit e5f968a7fb
10 changed files with 30 additions and 26 deletions

View File

@@ -23,7 +23,7 @@ namespace Content.Server.NodeContainer.EntitySystems
SubscribeLocalEvent<NodeContainerComponent, ComponentShutdown>(OnShutdownEvent);
SubscribeLocalEvent<NodeContainerComponent, AnchorStateChangedEvent>(OnAnchorStateChanged);
SubscribeLocalEvent<NodeContainerComponent, ReAnchorEvent>(OnReAnchor);
SubscribeLocalEvent<NodeContainerComponent, RotateEvent>(OnRotateEvent);
SubscribeLocalEvent<NodeContainerComponent, MoveEvent>(OnMoveEvent);
SubscribeLocalEvent<NodeContainerComponent, ExaminedEvent>(OnExamine);
}
@@ -81,14 +81,14 @@ namespace Content.Server.NodeContainer.EntitySystems
}
}
private void OnRotateEvent(EntityUid uid, NodeContainerComponent container, ref RotateEvent ev)
private void OnMoveEvent(EntityUid uid, NodeContainerComponent container, ref MoveEvent ev)
{
if (ev.NewRotation == ev.OldRotation)
{
return;
}
var xform = Transform(uid);
var xform = ev.Component;
foreach (var node in container.Nodes.Values)
{
@@ -99,7 +99,7 @@ namespace Content.Server.NodeContainer.EntitySystems
if (!node.Connectable(EntityManager, xform))
continue;
if (rotatableNode.RotateEvent(ref ev))
if (rotatableNode.RotateNode(in ev))
_nodeGroupSystem.QueueReflood(node);
}
}

View File

@@ -1,7 +1,7 @@
namespace Content.Server.NodeContainer.Nodes
namespace Content.Server.NodeContainer.Nodes
{
/// <summary>
/// A <see cref="Node"/> that implements this will have its <see cref="RotateEvent(RotateEvent)"/> called when its
/// A <see cref="Node"/> that implements this will have its <see cref="RotateNode(MoveEvent)"/> called when its
/// <see cref="NodeContainerComponent"/> is rotated.
/// </summary>
public interface IRotatableNode
@@ -9,6 +9,6 @@
/// <summary>
/// Rotates this <see cref="Node"/>. Returns true if the node's connections need to be updated.
/// </summary>
bool RotateEvent(ref RotateEvent ev);
bool RotateNode(in MoveEvent ev);
}
}

View File

@@ -114,7 +114,7 @@ namespace Content.Server.NodeContainer.Nodes
CurrentPipeDirection = _originalPipeDirection.RotatePipeDirection(xform.LocalRotation);
}
bool IRotatableNode.RotateEvent(ref RotateEvent ev)
bool IRotatableNode.RotateNode(in MoveEvent ev)
{
if (_originalPipeDirection == PipeDirection.Fourway)
return false;