Adds false alarm and updates events code (#2577)
* oops accedentaly ports how ss13 deals with event randomness. Also renames FakeEvent to FalseAlarm! * thing * greytide but it's implemented badly * fixes&changies, also greytide! * rng actualy exists now * resync * Naming Schemes * Startup not init * areas are dead * very cool vsudio * this does not exist, wtf * Cleanup * Nullables, fixables, and timings Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.GameObjects.EntitySystems.StationEvents;
|
||||
using NUnit.Framework;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
@@ -17,23 +17,27 @@ namespace Content.IntegrationTests.Tests.StationEvents
|
||||
|
||||
server.Assert(() =>
|
||||
{
|
||||
// Idle each event once
|
||||
// Idle each event
|
||||
var stationEventsSystem = EntitySystem.Get<StationEventSystem>();
|
||||
var dummyFrameTime = (float) IoCManager.Resolve<IGameTiming>().TickPeriod.TotalSeconds;
|
||||
|
||||
foreach (var stationEvent in stationEventsSystem.StationEvents)
|
||||
{
|
||||
stationEvent.Announce();
|
||||
stationEvent.Update(dummyFrameTime);
|
||||
stationEvent.Startup();
|
||||
stationEvent.Update(dummyFrameTime);
|
||||
stationEvent.Running = false;
|
||||
stationEvent.Shutdown();
|
||||
Assert.That(stationEvent.Occurrences == 1);
|
||||
// Due to timings some events might startup twice when in reality they wouldn't.
|
||||
Assert.That(stationEvent.Occurrences > 0);
|
||||
}
|
||||
|
||||
stationEventsSystem.Reset();
|
||||
|
||||
foreach (var stationEvent in stationEventsSystem.StationEvents)
|
||||
{
|
||||
Assert.That(stationEvent.Occurrences == 0);
|
||||
Assert.That(stationEvent.Occurrences, Is.EqualTo(0));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user