mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user