Fix tests (#20017)
This commit is contained in:
@@ -21,7 +21,19 @@ public sealed class StationJobsTest
|
||||
[TestPrototypes]
|
||||
private const string Prototypes = @"
|
||||
- type: playTimeTracker
|
||||
id: PlayTimeDummy
|
||||
id: PlayTimeDummyAssistant
|
||||
|
||||
- type: playTimeTracker
|
||||
id: PlayTimeDummyMime
|
||||
|
||||
- type: playTimeTracker
|
||||
id: PlayTimeDummyClown
|
||||
|
||||
- type: playTimeTracker
|
||||
id: PlayTimeDummyCaptain
|
||||
|
||||
- type: playTimeTracker
|
||||
id: PlayTimeDummyChaplain
|
||||
|
||||
- type: gameMap
|
||||
id: FooStation
|
||||
@@ -44,26 +56,26 @@ public sealed class StationJobsTest
|
||||
|
||||
- type: job
|
||||
id: TAssistant
|
||||
playTimeTracker: PlayTimeDummy
|
||||
playTimeTracker: PlayTimeDummyAssistant
|
||||
|
||||
- type: job
|
||||
id: TMime
|
||||
weight: 20
|
||||
playTimeTracker: PlayTimeDummy
|
||||
playTimeTracker: PlayTimeDummyMime
|
||||
|
||||
- type: job
|
||||
id: TClown
|
||||
weight: -10
|
||||
playTimeTracker: PlayTimeDummy
|
||||
playTimeTracker: PlayTimeDummyClown
|
||||
|
||||
- type: job
|
||||
id: TCaptain
|
||||
weight: 10
|
||||
playTimeTracker: PlayTimeDummy
|
||||
playTimeTracker: PlayTimeDummyCaptain
|
||||
|
||||
- type: job
|
||||
id: TChaplain
|
||||
playTimeTracker: PlayTimeDummy
|
||||
playTimeTracker: PlayTimeDummyChaplain
|
||||
";
|
||||
|
||||
private const int StationCount = 100;
|
||||
|
||||
@@ -30,17 +30,17 @@ public abstract class SharedJobSystem : EntitySystem
|
||||
{
|
||||
base.Shutdown();
|
||||
_protoManager.PrototypesReloaded -= OnProtoReload;
|
||||
_inverseTrackerLookup.Clear();
|
||||
}
|
||||
|
||||
private void OnProtoReload(PrototypesReloadedEventArgs obj)
|
||||
{
|
||||
_inverseTrackerLookup.Clear();
|
||||
SetupTrackerLookup();
|
||||
}
|
||||
|
||||
private void SetupTrackerLookup()
|
||||
{
|
||||
_inverseTrackerLookup.Clear();
|
||||
|
||||
// This breaks if you have N trackers to 1 JobId but future concern.
|
||||
foreach (var job in _protoManager.EnumeratePrototypes<JobPrototype>())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user