Adds tag support to construction (#3386)

This commit is contained in:
Vera Aguilera Puerto
2021-02-24 16:26:56 +01:00
committed by GitHub
parent 2ec0304072
commit 436d406585
11 changed files with 110 additions and 62 deletions

View 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);
}
}
}