public MNetworkAction(int WindowUid, NetworkDelegateTemplate DataDelegate, Dispatcher Dispatcher = null, string KeyNetwork = null, string UniqueDelegateName = null, bool NotSingle = false) { this.UniqueDelegateName = UniqueDelegateName; this.WindowUid = WindowUid; this.KeyNetwork = KeyNetwork; this.DataDelegate = DataDelegate; this.Dispatcher = Dispatcher; this.NotSingle = NotSingle; }
public static void Add(NetworkDelegateTemplate Delegate, Dispatcher Dispatcher = null, int WindowUid = -1, string KeyNetwork = null, string UniqueDelegateName = null, bool NotSingle = false) { if (NotSingle || UniqueDelegateName == null || !NetworkActions.Exists(x => x.UniqueDelegateName == UniqueDelegateName && x.KeyNetwork == KeyNetwork)) { Debug.Log($"Регистрация делегата: WindowUid - {WindowUid}, KeyNetwork - {KeyNetwork}"); NetworkActions.Add(new MNetworkAction(WindowUid, Delegate, Dispatcher, KeyNetwork, UniqueDelegateName, NotSingle)); } else { Debug.Log($"Обновление делегата: WindowUid - {WindowUid}, KeyNetwork - {KeyNetwork}"); NetworkActions.RemoveAll(x => x.UniqueDelegateName == UniqueDelegateName && x.KeyNetwork == KeyNetwork); NetworkActions.Add(new MNetworkAction(WindowUid, Delegate, Dispatcher, KeyNetwork, UniqueDelegateName, NotSingle)); } }
public MNetworkAction(NetworkDelegateTemplate DataDelegate, string KeyNetwork = null, int WindowUid = -1) { this.WindowUid = WindowUid; this.KeyNetwork = KeyNetwork; this.DataDelegate = DataDelegate; }
public static void Add(NetworkDelegateTemplate Delegate, string KeyNetwork = null, int WindowUid = -1) { Debug.Log($"Регистрация делегата: WindowUid - {WindowUid}, KeyNetwork - {KeyNetwork}"); NetworkActions.Add(new MNetworkAction(Delegate, KeyNetwork, WindowUid)); }