Adds tag support to construction (#3386)
This commit is contained in:
committed by
GitHub
parent
2ec0304072
commit
436d406585
25
Content.Shared/Construction/TagConstructionGraphStep.cs
Normal file
25
Content.Shared/Construction/TagConstructionGraphStep.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
#nullable enable
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.GameObjects.Components.Tag;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Construction
|
||||
{
|
||||
public class TagConstructionGraphStep : ArbitraryInsertConstructionGraphStep
|
||||
{
|
||||
private string? _tag = null;
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref _tag, "tag", null);
|
||||
}
|
||||
|
||||
public override bool EntityValid(IEntity entity)
|
||||
{
|
||||
return !string.IsNullOrEmpty(_tag) && entity.HasTag(_tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user