Replace uses of ProtoId<EntityPrototype> with ProtoId<EntityCategoryPrototype> (#5762)

This commit is contained in:
Tayrtahn
2025-03-20 23:08:12 -04:00
committed by GitHub
parent 2b16e4db96
commit 4529a7569a
2 changed files with 9 additions and 9 deletions

View File

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

View File

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