public void PushEvent(StateEvent ev)
        {
            if (ev == null)
            {
                return;
            }

            _events.Enqueue(ev);
        }
 public void DispatchEvents(StateEvent ev)
 {
     _isDispatching = true;
     foreach (var lis in _listeners)
     {
         if (ev.CanDispatch(lis))
         {
             ev.Dispatch(lis);
         }
     }
     _isDispatching = false;
 }