Files
RobustToolbox/Robust.Server/Toolshed/Commands/Players/ActorCommand.cs
2023-10-24 20:18:58 +11:00

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