RND Rework [Death to Techweb] (#16370)

* Techweb rework

* more ui work

* finishing ui

* Finish all the C# logic

* the techs + lathes

* remove old-tech

* mirror-review
This commit is contained in:
Nemanja
2023-05-15 16:17:30 -04:00
committed by GitHub
parent a71d9c8eff
commit 9efc727fe1
51 changed files with 1732 additions and 1401 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Content.Shared.Lathe;
using Content.Shared.Research.Prototypes;
@@ -10,6 +11,40 @@ namespace Content.IntegrationTests.Tests;
[TestFixture]
public sealed class ResearchTest
{
[Test]
public async Task DisciplineValidTierPrerequesitesTest()
{
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings {NoClient = true});
var server = pairTracker.Pair.Server;
var protoManager = server.ResolveDependency<IPrototypeManager>();
await server.WaitAssertion(() =>
{
var allTechs = protoManager.EnumeratePrototypes<TechnologyPrototype>().ToList();
foreach (var discipline in protoManager.EnumeratePrototypes<TechDisciplinePrototype>())
{
foreach (var tech in allTechs)
{
if (tech.Discipline != discipline.ID)
continue;
// we ignore these, anyways
if (tech.Tier == 1)
continue;
Assert.That(tech.Tier, Is.GreaterThan(0), $"Technology {tech} has invalid tier {tech.Tier}.");
Assert.That(discipline.TierPrerequisites.ContainsKey(tech.Tier),
$"Discipline {discipline.ID} does not have a TierPrerequisites definition for tier {tech.Tier}");
}
}
});
await pairTracker.CleanReturnAsync();
}
[Test]
public async Task AllTechPrintableTest()
{
@@ -40,14 +75,13 @@ public sealed class ResearchTest
foreach (var recipe in lathe.DynamicRecipes)
{
if (!latheTechs.Contains(recipe))
latheTechs.Add(recipe);
latheTechs.Add(recipe);
}
}
foreach (var tech in protoManager.EnumeratePrototypes<TechnologyPrototype>())
{
foreach (var recipe in tech.UnlockedRecipes)
foreach (var recipe in tech.RecipeUnlocks)
{
Assert.That(latheTechs, Does.Contain(recipe), $"Recipe \"{recipe}\" cannot be unlocked on any lathes.");
}