Update content to new ParallelManager (#21813)

This commit is contained in:
metalgearsloth
2023-11-29 11:00:12 +11:00
committed by GitHub
parent 03ed3ff37c
commit 7ada1c6674
9 changed files with 221 additions and 90 deletions

View File

@@ -1,6 +1,8 @@
using System.Collections.Generic;
using System.Diagnostics;
using Content.Server.Power.Pow3r;
using Robust.Shared.Threading;
using Robust.UnitTesting;
using static Content.Server.Power.Pow3r.PowerState;
@@ -32,6 +34,8 @@ namespace Pow3r
private readonly Queue<object> _remQueue = new();
private readonly Stopwatch _simStopwatch = new Stopwatch();
private IParallelManager _parallel = new TestingParallelManager();
private void Tick(float frameTime)
{
if (_paused)
@@ -45,7 +49,7 @@ namespace Pow3r
_simStopwatch.Restart();
_tickDataIdx = (_tickDataIdx + 1) % MaxTickData;
_solvers[_currentSolver].Tick(frameTime, _state, 1);
_solvers[_currentSolver].Tick(frameTime, _state, _parallel);
// Update tick history.
foreach (var load in _state.Loads.Values)