tag:with toolshed command (#31751)

This commit is contained in:
dffdff2423
2024-11-15 17:45:08 +00:00
committed by deltanedas
parent 01024313dd
commit a48bc2d02f
2 changed files with 13 additions and 1 deletions
@@ -25,6 +25,16 @@ public sealed class TagCommand : ToolshedCommand
});
}
[CommandImplementation("with")]
public IEnumerable<EntityUid> With(
[CommandInvocationContext] IInvocationContext ctx,
[PipedArgument] IEnumerable<EntityUid> entities,
[CommandArgument] ValueRef<string, Prototype<TagPrototype>> tag)
{
_tag ??= GetSys<TagSystem>();
return entities.Where(e => _tag.HasTag(e, tag.Evaluate(ctx)!));
}
[CommandImplementation("add")]
public EntityUid Add(
[CommandInvocationContext] IInvocationContext ctx,
@@ -1,4 +1,4 @@
command-description-visualize =
command-description-visualize =
Takes the input list of entities and puts them into a UI window for easy browsing.
command-description-runverbas =
Runs a verb over the input entities with the given user.
@@ -58,6 +58,8 @@ command-description-rejuvenate =
Rejuvenates the given entities, restoring them to full health, clearing status effects, etc.
command-description-tag-list =
Lists tags on the given entities.
command-description-tag-with =
Returns only the entities with the given tag from the piped list of entities.
command-description-tag-add =
Adds a tag to the given entities.
command-description-tag-rm =