Add storage fill test (#15758)

This commit is contained in:
Leon Friedrich
2023-04-25 12:30:35 +12:00
committed by GitHub
parent e4334bb28a
commit 5f3d3ecfc1
3 changed files with 105 additions and 2 deletions

View File

@@ -670,6 +670,25 @@ we are just going to end this here to save a lot of time. This is the exception
Assert.That(passed);
}
/// <summary>
/// Helper method that retrieves all entity prototypes that have some component.
/// </summary>
public static List<EntityPrototype> GetEntityPrototypes<T>(RobustIntegrationTest.IntegrationInstance instance) where T : Component
{
var protoMan = instance.ResolveDependency<IPrototypeManager>();
var compFact = instance.ResolveDependency<IComponentFactory>();
var id = compFact.GetComponentName(typeof(T));
var list = new List<EntityPrototype>();
foreach (var ent in protoMan.EnumeratePrototypes<EntityPrototype>())
{
if (ent.Components.ContainsKey(id))
list.Add(ent);
}
return list;
}
}
/// <summary>