mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
25 lines
753 B
C#
25 lines
753 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Robust.Server.GameObjects;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Player;
|
|
using Robust.Shared.Toolshed;
|
|
|
|
namespace Robust.Server.Toolshed.Commands.Players;
|
|
|
|
[ToolshedCommand]
|
|
public sealed class ActorCommand : ToolshedCommand
|
|
{
|
|
[CommandImplementation("controlled")]
|
|
public IEnumerable<EntityUid> Controlled([PipedArgument] IEnumerable<EntityUid> input)
|
|
{
|
|
return input.Where(HasComp<ActorComponent>);
|
|
}
|
|
|
|
[CommandImplementation("session")]
|
|
public IEnumerable<ICommonSession> Session([PipedArgument] IEnumerable<EntityUid> input)
|
|
{
|
|
return input.Where(HasComp<ActorComponent>).Select(x => Comp<ActorComponent>(x).PlayerSession);
|
|
}
|
|
}
|