Replace SpriteStateChange construction action with AppearanceChange (#15914)

This commit is contained in:
Leon Friedrich
2023-04-30 09:04:31 +12:00
committed by GitHub
parent fe3ebd0157
commit b45bc4ae4a
58 changed files with 293 additions and 287 deletions

View File

@@ -90,6 +90,23 @@ namespace Content.Server.Construction
return GetCurrentNode(uid, construction) is not {} node ? null : GetEdgeFromNode(node, edgeIndex);
}
/// <summary>
/// Variant of <see cref="GetCurrentEdge"/> that returns both the node and edge.
/// </summary>
public (ConstructionGraphNode?, ConstructionGraphEdge?) GetCurrentNodeAndEdge(EntityUid uid, ConstructionComponent? construction = null)
{
if (!Resolve(uid, ref construction, false))
return (null, null);
if (GetCurrentNode(uid, construction) is not { } node)
return (null, null);
if (construction.EdgeIndex is not {} edgeIndex)
return (node, null);
return (node, GetEdgeFromNode(node, edgeIndex));
}
/// <summary>
/// Gets the construction graph step the entity is currently at, or null.
/// </summary>