mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Replace uses of ProtoId<EntityPrototype> with ProtoId<EntityCategoryPrototype> (#5762)
This commit is contained in:
@@ -197,21 +197,21 @@ public sealed class TestEnumerableCommand : ToolshedCommand
|
||||
public sealed class TestNestedArrayCommand : ToolshedCommand
|
||||
{
|
||||
[CommandImplementation]
|
||||
public ProtoId<EntityPrototype>[] Impl() => Array.Empty<ProtoId<EntityPrototype>>();
|
||||
public ProtoId<EntityCategoryPrototype>[] Impl() => [];
|
||||
}
|
||||
|
||||
[ToolshedCommand]
|
||||
public sealed class TestNestedListCommand : ToolshedCommand
|
||||
{
|
||||
[CommandImplementation]
|
||||
public List<ProtoId<EntityPrototype>> Impl() => new();
|
||||
public List<ProtoId<EntityCategoryPrototype>> Impl() => new();
|
||||
}
|
||||
|
||||
[ToolshedCommand]
|
||||
public sealed class TestNestedEnumerableCommand : ToolshedCommand
|
||||
{
|
||||
private static ProtoId<EntityPrototype>[] _arr = Array.Empty<ProtoId<EntityPrototype>>();
|
||||
private static ProtoId<EntityCategoryPrototype>[] _arr = [];
|
||||
|
||||
[CommandImplementation]
|
||||
public IEnumerable<ProtoId<EntityPrototype>> Impl() => _arr.OrderByDescending(x => x.Id);
|
||||
public IEnumerable<ProtoId<EntityCategoryPrototype>> Impl() => _arr.OrderByDescending(x => x.Id);
|
||||
}
|
||||
|
||||
@@ -383,11 +383,11 @@ public sealed class ToolshedTests : ToolshedTest
|
||||
AssertResult("testenumerable testenumerableinfer 1", typeof(int));
|
||||
|
||||
// Repeat but with nested types. i.e. extracting T when piping ProtoId<T> -> IEnumerable<ProtoId<T>>
|
||||
AssertResult("testnestedarray testnestedarrayinfer", typeof(EntityPrototype));
|
||||
AssertResult("testnestedlist testnestedlistinfer", typeof(EntityPrototype));
|
||||
AssertResult("testnestedarray testnestedenumerableinfer", typeof(EntityPrototype));
|
||||
AssertResult("testnestedlist testnestedenumerableinfer", typeof(EntityPrototype));
|
||||
AssertResult("testnestedenumerable testnestedenumerableinfer", typeof(EntityPrototype));
|
||||
AssertResult("testnestedarray testnestedarrayinfer", typeof(EntityCategoryPrototype));
|
||||
AssertResult("testnestedlist testnestedlistinfer", typeof(EntityCategoryPrototype));
|
||||
AssertResult("testnestedarray testnestedenumerableinfer", typeof(EntityCategoryPrototype));
|
||||
AssertResult("testnestedlist testnestedenumerableinfer", typeof(EntityCategoryPrototype));
|
||||
AssertResult("testnestedenumerable testnestedenumerableinfer", typeof(EntityCategoryPrototype));
|
||||
|
||||
// The map command used to work when the piped type was passed as an IEnumerable<T> directly, but would fail
|
||||
// when given a List<T> or something else that implemented the interface.
|
||||
|
||||
Reference in New Issue
Block a user