Revert "Refactor Game Modes" oh god oh fuck go back it was too good to be true (#5855)
This commit is contained in:
@@ -4,14 +4,12 @@ using Content.Server.GameTicking;
|
||||
using Content.Server.GameTicking.Rules;
|
||||
using NUnit.Framework;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.IntegrationTests.Tests.GameRules
|
||||
{
|
||||
[TestFixture]
|
||||
[TestOf(typeof(MaxTimeRestartRuleSystem))]
|
||||
[TestOf(typeof(RuleMaxTimeRestart))]
|
||||
public class RuleMaxTimeRestartTest : ContentIntegrationTest
|
||||
{
|
||||
[Test]
|
||||
@@ -21,9 +19,7 @@ namespace Content.IntegrationTests.Tests.GameRules
|
||||
{
|
||||
CVarOverrides =
|
||||
{
|
||||
["game.lobbyenabled"] = "true",
|
||||
["game.dummyticker"] = "false",
|
||||
["game.defaultpreset"] = "", // No preset.
|
||||
["game.lobbyenabled"] = "true"
|
||||
}
|
||||
};
|
||||
var server = StartServer(options);
|
||||
@@ -31,15 +27,16 @@ namespace Content.IntegrationTests.Tests.GameRules
|
||||
await server.WaitIdleAsync();
|
||||
|
||||
var sGameTicker = server.ResolveDependency<IEntitySystemManager>().GetEntitySystem<GameTicker>();
|
||||
var maxTimeMaxTimeRestartRuleSystem = server.ResolveDependency<IEntitySystemManager>().GetEntitySystem<MaxTimeRestartRuleSystem>();
|
||||
var sGameTiming = server.ResolveDependency<IGameTiming>();
|
||||
|
||||
RuleMaxTimeRestart maxTimeRule = null;
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
Assert.That(sGameTicker.RunLevel, Is.EqualTo(GameRunLevel.PreRoundLobby));
|
||||
|
||||
sGameTicker.AddGameRule(IoCManager.Resolve<IPrototypeManager>().Index<GameRulePrototype>(maxTimeMaxTimeRestartRuleSystem.Prototype));
|
||||
maxTimeMaxTimeRestartRuleSystem.RoundMaxTime = TimeSpan.FromSeconds(3);
|
||||
maxTimeRule = sGameTicker.AddGameRule<RuleMaxTimeRestart>();
|
||||
maxTimeRule.RoundMaxTime = TimeSpan.FromSeconds(3);
|
||||
|
||||
sGameTicker.StartRound();
|
||||
});
|
||||
@@ -49,7 +46,7 @@ namespace Content.IntegrationTests.Tests.GameRules
|
||||
Assert.That(sGameTicker.RunLevel, Is.EqualTo(GameRunLevel.InRound));
|
||||
});
|
||||
|
||||
var ticks = sGameTiming.TickRate * (int) Math.Ceiling(maxTimeMaxTimeRestartRuleSystem.RoundMaxTime.TotalSeconds * 1.1f);
|
||||
var ticks = sGameTiming.TickRate * (int) Math.Ceiling(maxTimeRule.RoundMaxTime.TotalSeconds * 1.1f);
|
||||
await server.WaitRunTicks(ticks);
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
@@ -57,7 +54,7 @@ namespace Content.IntegrationTests.Tests.GameRules
|
||||
Assert.That(sGameTicker.RunLevel, Is.EqualTo(GameRunLevel.PostRound));
|
||||
});
|
||||
|
||||
ticks = sGameTiming.TickRate * (int) Math.Ceiling(maxTimeMaxTimeRestartRuleSystem.RoundEndDelay.TotalSeconds * 1.1f);
|
||||
ticks = sGameTiming.TickRate * (int) Math.Ceiling(maxTimeRule.RoundEndDelay.TotalSeconds * 1.1f);
|
||||
await server.WaitRunTicks(ticks);
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
|
||||
Reference in New Issue
Block a user