tag:with toolshed command (#31751)

This commit is contained in:
dffdff2423
2024-11-13 18:27:31 -05:00
committed by GitHub
parent 6f7066eda8
commit 51d2b51ad0
2 changed files with 13 additions and 1 deletions

View File

@@ -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,

View File

@@ -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 =