using System; using System.Collections.Generic; using Robust.Shared.GameObjects; namespace Robust.Client.UserInterface.Controllers; public abstract partial class UIController : IEntityEventSubscriber { protected void SubscribeLocalEvent( EntityEventHandler handler, Type[]? before = null, Type[]? after = null) where T : notnull { EntityManager.EventBus.SubscribeEvent(EventSource.Local, this, handler, GetType(), before, after); } protected void SubscribeLocalEvent( EntityEventRefHandler handler, Type[]? before = null, Type[]? after = null) where T : notnull { EntityManager.EventBus.SubscribeEvent(EventSource.Local, this, handler, GetType(), before, after); } protected void UnSubscribeLocalEvent() where T : notnull { EntityManager.EventBus.UnsubscribeEvent(EventSource.Local, this); } protected void SubscribeNetworkEvent( EntitySessionEventHandler handler, Type[]? before = null, Type[]? after = null) where T : notnull { EntityManager.EventBus.SubscribeSessionEvent(EventSource.Network, this, handler, GetType(), before, after); } protected void UnSubscribeNetworkEvent() where T : notnull { EntityManager.EventBus.UnsubscribeEvent(EventSource.Network, this); } protected void SubscribeAllEvent( EntitySessionEventHandler handler, Type[]? before = null, Type[]? after = null) where T : notnull { EntityManager.EventBus.SubscribeSessionEvent(EventSource.All, this, handler, GetType(), before, after); } protected void UnSubscribeAllEvent() where T : notnull { EntityManager.EventBus.UnsubscribeEvent(EventSource.All, this); } }