mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
* Try fix invalid PVS index bug * bounds check * More Asserts * fix assert? * remove deletion * a * A!
20 lines
664 B
C#
20 lines
664 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Numerics;
|
|
using Robust.Shared.Toolshed.Syntax;
|
|
|
|
namespace Robust.Shared.Toolshed.Commands.Generic.ListGeneration;
|
|
|
|
[ToolshedCommand]
|
|
public sealed class ToCommand : ToolshedCommand
|
|
{
|
|
[CommandImplementation, TakesPipedTypeAsGeneric]
|
|
public IEnumerable<T> To<T>(
|
|
[CommandInvocationContext] IInvocationContext ctx,
|
|
[PipedArgument] T start,
|
|
[CommandArgument] ValueRef<T> end
|
|
)
|
|
where T : INumber<T>
|
|
=> Enumerable.Range(int.CreateTruncating(start), 1 + int.CreateTruncating(end.Evaluate(ctx)! - start)).Select(T.CreateTruncating);
|
|
}
|