protected void SubscribeAllEvent <T>(
     EntitySessionEventHandler <T> handler,
     Type[]?before = null, Type[]?after = null)
     where T : notnull
 {
     SubSessionEvent(EventSource.All, handler, before, after);
 }
        protected void SubscribeLocalEvent <T>(EntitySessionEventHandler <T> handler)
            where T : notnull
        {
            EntityManager.EventBus.SubscribeSessionEvent(EventSource.Local, this, handler);

            _subscriptions ??= new();
            _subscriptions.Add(new SubBroadcast <EntitySessionMessage <T> >(EventSource.Local));
        }
Exemplo n.º 3
0
 public void SubSessionEvent <T>(
     EventSource src,
     EntitySessionEventHandler <T> handler,
     Type[]?before = null, Type[]?after = null)
     where T : notnull
 {
     System.SubSessionEvent(src, handler, before, after);
 }
Exemplo n.º 4
0
        public static void SubscribeSessionEvent <T>(
            this IEventBus eventBus,
            EventSource source,
            IEntityEventSubscriber subscriber,
            EntitySessionEventHandler <T> handler)
        {
            var wrapper = new HandlerWrapper <T>(handler);

            eventBus.SubscribeEvent <EntitySessionMessage <T> >(source, subscriber, wrapper.Invoke);
        }
        private void SubSessionEvent <T>(
            EventSource src,
            EntitySessionEventHandler <T> handler,
            Type[]?before, Type[]?after)
            where T : notnull
        {
            EntityManager.EventBus.SubscribeSessionEvent(src, this, handler, GetType(), before, after);

            _subscriptions ??= new();
            _subscriptions.Add(new SubBroadcast <EntitySessionMessage <T> >(src));
        }
Exemplo n.º 6
0
        public static void SubscribeSessionEvent <T>(
            this IEventBus eventBus,
            EventSource source,
            IEntityEventSubscriber subscriber,
            EntitySessionEventHandler <T> handler,
            Type orderType,
            Type[]?before = null,
            Type[]?after  = null)
        {
            var wrapper = new HandlerWrapper <T>(handler);

            eventBus.SubscribeEvent <EntitySessionMessage <T> >(
                source,
                subscriber,
                wrapper.Invoke,
                orderType,
                before, after);
        }
Exemplo n.º 7
0
 public HandlerWrapper(EntitySessionEventHandler <T> handler)
 {
     Handler = handler;
 }
Exemplo n.º 8
0
 protected void SubscribeLocalEvent <T>(EntitySessionEventHandler <T> handler)
     where T : EntitySystemMessage
 {
     EntityManager.EventBus.SubscribeSessionEvent(EventSource.Local, this, handler);
 }
Exemplo n.º 9
0
 protected void SubscribeNetworkEvent <T>(EntitySessionEventHandler <T> handler)
     where T : notnull
 {
     EntityManager.EventBus.SubscribeSessionEvent(EventSource.Network, this, handler);
 }