TagConstructionGraphStep.cs 567 B

1234567891011121314151617
  1. using Content.Shared.Tag;
  2. namespace Content.Shared.Construction.Steps
  3. {
  4. [DataDefinition]
  5. public sealed partial class TagConstructionGraphStep : ArbitraryInsertConstructionGraphStep
  6. {
  7. [DataField("tag")]
  8. private string? _tag;
  9. public override bool EntityValid(EntityUid uid, IEntityManager entityManager, IComponentFactory compFactory)
  10. {
  11. var tagSystem = entityManager.EntitySysManager.GetEntitySystem<TagSystem>();
  12. return !string.IsNullOrEmpty(_tag) && tagSystem.HasTag(uid, _tag);
  13. }
  14. }
  15. }