Sentry turrets - Part 7: Electronics and construction graphs (#35236)
* Initial commit * Fixing merge conflict * Updated for deployment * Whitespace fixes * Linter fixes * Test fail fix * Fixed test failure * Add separate command circuitboards * Addressed review comments
This commit is contained in:
@@ -12,7 +12,8 @@ namespace Content.Shared.Construction.NodeEntities;
|
||||
[DataDefinition]
|
||||
public sealed partial class BoardNodeEntity : IGraphNodeEntity
|
||||
{
|
||||
[DataField("container")] public string Container { get; private set; } = string.Empty;
|
||||
[DataField]
|
||||
public string Container { get; private set; } = string.Empty;
|
||||
|
||||
public string? GetId(EntityUid? uid, EntityUid? userUid, GraphNodeEntityArgs args)
|
||||
{
|
||||
@@ -27,13 +28,16 @@ public sealed partial class BoardNodeEntity : IGraphNodeEntity
|
||||
|
||||
var board = container.ContainedEntities[0];
|
||||
|
||||
// There should not be a case where both of these components exist on the same entity...
|
||||
// There should not be a case where more than one of these components exist on the same entity
|
||||
if (args.EntityManager.TryGetComponent(board, out MachineBoardComponent? machine))
|
||||
return machine.Prototype;
|
||||
|
||||
if (args.EntityManager.TryGetComponent(board, out ComputerBoardComponent? computer))
|
||||
return computer.Prototype;
|
||||
|
||||
if (args.EntityManager.TryGetComponent(board, out ElectronicsBoardComponent? electronics))
|
||||
return electronics.Prototype;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user