1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00
implement basic run-as functionality
This commit is contained in:
RaidMax
2020-04-26 21:12:49 -05:00
parent 6757f9055c
commit 9a245c4db2
20 changed files with 1294 additions and 18 deletions

View File

@ -7,10 +7,22 @@ namespace ApplicationTests.Mocks
class MockEventHandler : IEventHandler
{
public IList<GameEvent> Events = new List<GameEvent>();
private readonly bool _autoExecute;
public MockEventHandler(bool autoExecute = false)
{
_autoExecute = autoExecute;
}
public void AddEvent(GameEvent gameEvent)
{
Events.Add(gameEvent);
if (_autoExecute)
{
gameEvent.Owner?.ExecuteEvent(gameEvent);
gameEvent.Complete();
}
}
}
}