com.wallstop-studios.dxmessaging 2.0.0-rc14 → 2.0.0-rc16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 1,
3
+ "isRoot": true,
4
+ "tools": {
5
+ "CSharpier": {
6
+ "version": "0.30.6",
7
+ "commands": ["dotnet-csharpier"]
8
+ }
9
+ }
10
+ }
package/.editorconfig ADDED
@@ -0,0 +1,184 @@
1
+
2
+ [*]
3
+ charset = utf-8-bom
4
+ end_of_line = crlf
5
+ trim_trailing_whitespace = false
6
+ insert_final_newline = false
7
+ indent_style = space
8
+ indent_size = 4
9
+
10
+ # Microsoft .NET properties
11
+ csharp_new_line_before_members_in_object_initializers = false
12
+ csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
13
+ csharp_prefer_braces = true:suggestion
14
+ csharp_style_prefer_utf8_string_literals = true:suggestion
15
+ csharp_style_var_elsewhere = false:suggestion
16
+ csharp_style_var_for_built_in_types = false:suggestion
17
+ csharp_style_var_when_type_is_apparent = false:suggestion
18
+ csharp_using_directive_placement = inside_namespace:silent
19
+ dotnet_naming_rule.event_rule.import_to_resharper = True
20
+ dotnet_naming_rule.event_rule.resharper_description = Events
21
+ dotnet_naming_rule.event_rule.resharper_guid = 0c4c6401-2a1f-4db1-a21f-562f51542cf8
22
+ dotnet_naming_rule.event_rule.severity = warning
23
+ dotnet_naming_rule.event_rule.style = on_upper_camel_case_style
24
+ dotnet_naming_rule.event_rule.symbols = event_symbols
25
+ dotnet_naming_rule.interfaces_rule.import_to_resharper = True
26
+ dotnet_naming_rule.interfaces_rule.resharper_description = Interfaces
27
+ dotnet_naming_rule.interfaces_rule.resharper_guid = a7a3339e-4e89-4319-9735-a9dc4cb74cc7
28
+ dotnet_naming_rule.interfaces_rule.severity = warning
29
+ dotnet_naming_rule.interfaces_rule.style = i_upper_camel_case_style
30
+ dotnet_naming_rule.interfaces_rule.symbols = interfaces_symbols
31
+ dotnet_naming_rule.local_constants_rule.import_to_resharper = True
32
+ dotnet_naming_rule.local_constants_rule.resharper_description = Local constants
33
+ dotnet_naming_rule.local_constants_rule.resharper_guid = a4f433b8-abcd-4e55-a08f-82e78cef0f0c
34
+ dotnet_naming_rule.local_constants_rule.resharper_style = AaBb, aaBb
35
+ dotnet_naming_rule.local_constants_rule.severity = warning
36
+ dotnet_naming_rule.local_constants_rule.style = upper_camel_case_style
37
+ dotnet_naming_rule.local_constants_rule.symbols = local_constants_symbols
38
+ dotnet_naming_rule.public_fields_override_rule.import_to_resharper = False
39
+ dotnet_naming_rule.public_fields_override_rule.severity = warning
40
+ dotnet_naming_rule.public_fields_override_rule.style = upper_camel_case_style
41
+ dotnet_naming_rule.public_fields_override_rule.symbols = public_fields_override_symbols
42
+ dotnet_naming_rule.public_fields_override_rule_1.import_to_resharper = False
43
+ dotnet_naming_rule.public_fields_override_rule_1.severity = warning
44
+ dotnet_naming_rule.public_fields_override_rule_1.style = upper_camel_case_style
45
+ dotnet_naming_rule.public_fields_override_rule_1.symbols = public_fields_override_symbols_1
46
+ dotnet_naming_rule.public_fields_rule.import_to_resharper = True
47
+ dotnet_naming_rule.public_fields_rule.resharper_description = Instance fields (not private)
48
+ dotnet_naming_rule.public_fields_rule.resharper_guid = 53eecf85-d821-40e8-ac97-fdb734542b84
49
+ dotnet_naming_rule.public_fields_rule.severity = warning
50
+ dotnet_naming_rule.public_fields_rule.style = lower_camel_case_style
51
+ dotnet_naming_rule.public_fields_rule.symbols = public_fields_symbols
52
+ dotnet_naming_rule.public_static_fields_rule.import_to_resharper = True
53
+ dotnet_naming_rule.public_static_fields_rule.resharper_description = Static fields (not private)
54
+ dotnet_naming_rule.public_static_fields_rule.resharper_guid = 70345118-4b40-4ece-937c-bbeb7a0b2e70
55
+ dotnet_naming_rule.public_static_fields_rule.severity = warning
56
+ dotnet_naming_rule.public_static_fields_rule.style = upper_camel_case_style
57
+ dotnet_naming_rule.public_static_fields_rule.symbols = public_static_fields_symbols
58
+ dotnet_naming_rule.type_parameters_rule.import_to_resharper = True
59
+ dotnet_naming_rule.type_parameters_rule.resharper_description = Type parameters
60
+ dotnet_naming_rule.type_parameters_rule.resharper_guid = 2c62818f-621b-4425-adc9-78611099bfcb
61
+ dotnet_naming_rule.type_parameters_rule.severity = warning
62
+ dotnet_naming_rule.type_parameters_rule.style = t_upper_camel_case_style
63
+ dotnet_naming_rule.type_parameters_rule.symbols = type_parameters_symbols
64
+ dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True
65
+ dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field
66
+ dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
67
+ dotnet_naming_rule.unity_serialized_field_rule.severity = none
68
+ dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style
69
+ dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols
70
+ dotnet_naming_style.i_upper_camel_case_style.capitalization = pascal_case
71
+ dotnet_naming_style.i_upper_camel_case_style.required_prefix = I
72
+ dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
73
+ dotnet_naming_style.on_upper_camel_case_style.capitalization = pascal_case
74
+ dotnet_naming_style.on_upper_camel_case_style.required_prefix = On
75
+ dotnet_naming_style.t_upper_camel_case_style.capitalization = pascal_case
76
+ dotnet_naming_style.t_upper_camel_case_style.required_prefix = T
77
+ dotnet_naming_style.upper_camel_case_style.capitalization = pascal_case
78
+ dotnet_naming_symbols.event_symbols.applicable_accessibilities = *
79
+ dotnet_naming_symbols.event_symbols.applicable_kinds = event
80
+ dotnet_naming_symbols.event_symbols.resharper_applicable_kinds = event
81
+ dotnet_naming_symbols.event_symbols.resharper_required_modifiers = any
82
+ dotnet_naming_symbols.interfaces_symbols.applicable_accessibilities = *
83
+ dotnet_naming_symbols.interfaces_symbols.applicable_kinds = interface
84
+ dotnet_naming_symbols.interfaces_symbols.resharper_applicable_kinds = interface
85
+ dotnet_naming_symbols.interfaces_symbols.resharper_required_modifiers = any
86
+ dotnet_naming_symbols.local_constants_symbols.applicable_accessibilities = *
87
+ dotnet_naming_symbols.local_constants_symbols.applicable_kinds = local
88
+ dotnet_naming_symbols.local_constants_symbols.required_modifiers = const
89
+ dotnet_naming_symbols.local_constants_symbols.resharper_applicable_kinds = local_constant
90
+ dotnet_naming_symbols.local_constants_symbols.resharper_required_modifiers = any
91
+ dotnet_naming_symbols.public_fields_override_symbols.applicable_accessibilities = public
92
+ dotnet_naming_symbols.public_fields_override_symbols.applicable_kinds = field
93
+ dotnet_naming_symbols.public_fields_override_symbols.required_modifiers = const
94
+ dotnet_naming_symbols.public_fields_override_symbols_1.applicable_accessibilities = public
95
+ dotnet_naming_symbols.public_fields_override_symbols_1.applicable_kinds = field
96
+ dotnet_naming_symbols.public_fields_override_symbols_1.required_modifiers = readonly,static
97
+ dotnet_naming_symbols.public_fields_symbols.applicable_accessibilities = public
98
+ dotnet_naming_symbols.public_fields_symbols.applicable_kinds = field
99
+ dotnet_naming_symbols.public_fields_symbols.resharper_applicable_kinds = field,readonly_field
100
+ dotnet_naming_symbols.public_fields_symbols.resharper_required_modifiers = instance
101
+ dotnet_naming_symbols.public_static_fields_symbols.applicable_accessibilities = public
102
+ dotnet_naming_symbols.public_static_fields_symbols.applicable_kinds = field
103
+ dotnet_naming_symbols.public_static_fields_symbols.required_modifiers = static
104
+ dotnet_naming_symbols.public_static_fields_symbols.resharper_applicable_kinds = field
105
+ dotnet_naming_symbols.public_static_fields_symbols.resharper_required_modifiers = static
106
+ dotnet_naming_symbols.type_parameters_symbols.applicable_accessibilities = *
107
+ dotnet_naming_symbols.type_parameters_symbols.applicable_kinds = type_parameter
108
+ dotnet_naming_symbols.type_parameters_symbols.resharper_applicable_kinds = type_parameter
109
+ dotnet_naming_symbols.type_parameters_symbols.resharper_required_modifiers = any
110
+ dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
111
+ dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
112
+ dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
113
+ dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
114
+ dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
115
+ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
116
+ dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
117
+ dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
118
+ dotnet_style_predefined_type_for_member_access = true:suggestion
119
+ dotnet_style_qualification_for_event = false:suggestion
120
+ dotnet_style_qualification_for_field = false:suggestion
121
+ dotnet_style_qualification_for_method = false:suggestion
122
+ dotnet_style_qualification_for_property = false:suggestion
123
+ dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
124
+
125
+ # ReSharper properties
126
+ resharper_autodetect_indent_settings = true
127
+ resharper_braces_redundant = true
128
+ resharper_csharp_wrap_lines = false
129
+ resharper_formatter_off_tag = @formatter:off
130
+ resharper_formatter_on_tag = @formatter:on
131
+ resharper_formatter_tags_enabled = true
132
+ resharper_indent_preprocessor_directives = normal
133
+ resharper_keep_existing_attribute_arrangement = true
134
+ resharper_place_attribute_on_same_line = false
135
+ resharper_show_autodetect_configure_formatting_tip = false
136
+ resharper_use_indent_from_vs = false
137
+
138
+ # ReSharper inspection severities
139
+ resharper_arrange_redundant_parentheses_highlighting = hint
140
+ resharper_arrange_this_qualifier_highlighting = hint
141
+ resharper_arrange_trailing_comma_in_multiline_lists_highlighting = none
142
+ resharper_arrange_type_member_modifiers_highlighting = hint
143
+ resharper_arrange_type_modifiers_highlighting = hint
144
+ resharper_built_in_type_reference_style_for_member_access_highlighting = hint
145
+ resharper_built_in_type_reference_style_highlighting = hint
146
+ resharper_mvc_action_not_resolved_highlighting = warning
147
+ resharper_mvc_area_not_resolved_highlighting = warning
148
+ resharper_mvc_controller_not_resolved_highlighting = warning
149
+ resharper_mvc_masterpage_not_resolved_highlighting = warning
150
+ resharper_mvc_partial_view_not_resolved_highlighting = warning
151
+ resharper_mvc_template_not_resolved_highlighting = warning
152
+ resharper_mvc_view_component_not_resolved_highlighting = warning
153
+ resharper_mvc_view_component_view_not_resolved_highlighting = warning
154
+ resharper_mvc_view_not_resolved_highlighting = warning
155
+ resharper_prefer_concrete_value_over_default_highlighting = none
156
+ resharper_razor_assembly_not_resolved_highlighting = warning
157
+ resharper_redundant_base_qualifier_highlighting = warning
158
+ resharper_suggest_var_or_type_built_in_types_highlighting = hint
159
+ resharper_suggest_var_or_type_elsewhere_highlighting = hint
160
+ resharper_suggest_var_or_type_simple_types_highlighting = hint
161
+ resharper_web_config_module_not_resolved_highlighting = warning
162
+ resharper_web_config_type_not_resolved_highlighting = warning
163
+ resharper_web_config_wrong_module_highlighting = warning
164
+
165
+ [{*.har,*.inputactions,*.jsb2,*.jsb3,*.json,*.jsonc,*.postman_collection,*.postman_collection.json,*.postman_environment,*.postman_environment.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,.ws-context,jest.config}]
166
+ indent_style = space
167
+ indent_size = 2
168
+
169
+ [{*.yaml,*.yml}]
170
+ indent_style = space
171
+ indent_size = 2
172
+
173
+ [*.asmdef]
174
+ indent_style = space
175
+ indent_size = 2
176
+
177
+ [*.asmref]
178
+ indent_style = space
179
+ indent_size = 2
180
+
181
+ [*.{appxmanifest,asax,ascx,aspx,axaml,blockshader,build,c,c++,c++m,cc,ccm,cginc,compute,cp,cpp,cppm,cs,cshtml,cu,cuh,cxx,cxxm,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,h++,hh,hlsl,hlsli,hlslinc,hp,hpp,hxx,icc,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,mxx,nuspec,paml,razor,resw,resx,shader,shaderFoundry,skin,tcc,tpp,urtshader,usf,ush,uxml,vb,xaml,xamlx,xoml,xsd}]
182
+ indent_style = space
183
+ indent_size = 4
184
+ tab_width = 4
@@ -0,0 +1,22 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: dotnet-tool-restore
5
+ name: Install .NET tools
6
+ entry: dotnet tool restore
7
+ language: system
8
+ always_run: true
9
+ pass_filenames: false
10
+ stages:
11
+ - pre-commit
12
+ - pre-push
13
+ - post-checkout
14
+ - post-rewrite
15
+ description: Install the .NET tools listed at .config/dotnet-tools.json.
16
+ - id: csharpier
17
+ name: Run CSharpier on C# files
18
+ entry: dotnet tool run dotnet-csharpier
19
+ language: system
20
+ types:
21
+ - c#
22
+ description: CSharpier is an opinionated C# formatter inspired by Prettier.
package/README.md CHANGED
@@ -16,6 +16,9 @@ Game engine agnostic robust, synchronous pub/sub C# messaging solution, mostly g
16
16
 
17
17
  # Installation
18
18
 
19
+ ## From Releases
20
+ Check out the latest [Releases](https://github.com/wallstop/DxMessaging/releases) to grab the Unity Package and import to your project.
21
+
19
22
  ## To Install as Unity Package
20
23
  1. Open Unity Package Manager
21
24
  2. (Optional) Enable Pre-release packages to get the latest, cutting-edge builds
@@ -29,23 +32,20 @@ Game engine agnostic robust, synchronous pub/sub C# messaging solution, mostly g
29
32
  ## From Source
30
33
  Grab a copy of this repo (either `git clone` both [this repo](https://github.com/wallstop/DxMessaging) *and* [Unity Helpers](https://github.com/wallstop/unity-helpers) or [download a zip of the source](https://github.com/wallstop/DxMessaging/archive/refs/heads/master.zip) and [Unity Helper's source](https://github.com/wallstop/unity-helpers/archive/refs/heads/main.zip)) and copy the contents to your project's `Assets` folder.
31
34
 
32
- ## From Releases
33
- Check out the latest [Releases](https://github.com/wallstop/DxMessaging/releases) to grab the Unity Package and import to your project.
34
-
35
35
  # Dependencies
36
36
  This project has a dependency on my [`Unity Helpers`](https://github.com/wallstop/unity-helpers) project, which contains the `System.Runtime.CompilerServices.Unsafe.dll`, which is used for some speed hacks in DxMessaging directly. Unity Helpers bundles a few (small) dependencies, including protobuf. If you don't want these dependencies, or if they conflict in some way, you can either include a copy of the `System.Runtime.CompilerServices.Unsafe.dll` yourself without relying on UnityHelpers, or manually download and include the Unity Helpers project and delete anything that conflicts with your project. Or, manually download this project without UnityHelpers. The choice is yours.
37
37
 
38
38
  # Benchmarks
39
39
  DxMessaging is currently a bit slower (2-3x) than Unity's built in messaging solution (when running in Unity). [Source](./Tests/Runtime/Benchmarks/PerformanceTests.cs).
40
40
 
41
- | Message Tech | Operations / Second | Memory Allocated |
42
- | ------------ | ------------------- | --------------- |
43
- | Unity | 2,302,247 | 76.83 GB |
44
- | DxMessaging (GameObject) - Normal | 1,223,941 | 3.52 MB |
45
- | DxMessaging (Component) - Normal | 1,229,897 | 2.83 MB |
46
- | DxMessaging (GameObject) - No-Copy | 1,172,148 | 2.83 MB |
47
- | DxMessaging (Component) - No-Copy | 1,258,505 | 3.03 MB |
48
- | DxMessaging (Untargeted) - No-Copy | 1,737,476 | 4.2 MB |
41
+ | Message Tech | Operations / Second | Allocations? |
42
+ | ------------ | ------------------- | ------------ |
43
+ | Unity | 2,287,562 | Yes |
44
+ | DxMessaging (GameObject) - Normal | 1,198,797 | No |
45
+ | DxMessaging (Component) - Normal | 1,198,796 | No |
46
+ | DxMessaging (GameObject) - No-Copy | 1,137,634 | No |
47
+ | DxMessaging (Component) - No-Copy | 1,225,105 | No |
48
+ | DxMessaging (Untargeted) - No-Copy | 1,681,407 | No |
49
49
 
50
50
  # Functionality
51
51
  While not as fast, DxMessaging offers *additional functionality* as compared to Unity's messaging solution.
@@ -64,6 +64,7 @@ While not as fast, DxMessaging offers *additional functionality* as compared to
64
64
  | Send a message without boxing its parameters | _ | ✓ |
65
65
  | Listen to all messages | _ | ✓ |
66
66
  | View a filter-able history of message registrations | N/A | ✓ |
67
+ | "PreUpdate" style handlers | _ | ✓ |
67
68
  | "LateUpdate" style handlers | _ | ✓ |
68
69
 
69
70
  # Concepts
@@ -23,7 +23,8 @@
23
23
  private readonly int _id;
24
24
 
25
25
  #if UNITY_2017_1_OR_NEWER
26
- public UnityEngine.Object Object { get; }
26
+ // ReSharper disable once InconsistentNaming
27
+ public readonly UnityEngine.Object Object;
27
28
  #endif
28
29
 
29
30
  [JsonConstructor]
@@ -36,10 +37,10 @@
36
37
  }
37
38
 
38
39
  #if UNITY_2017_1_OR_NEWER
39
- private InstanceId(UnityEngine.Object @object)
40
+ private InstanceId(UnityEngine.Object unityObject)
40
41
  {
41
- _id = @object.GetInstanceID();
42
- Object = @object;
42
+ _id = unityObject.GetInstanceID();
43
+ Object = unityObject;
43
44
  }
44
45
 
45
46
  [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -88,9 +89,9 @@
88
89
  #if UNITY_2017_1_OR_NEWER
89
90
  UnityEngine.Object instance = Object;
90
91
  string objectName = instance == null ? string.Empty : instance.name;
91
- return $"{{\"Id\": {_id}, \"Name\": \"{objectName}\"}}";
92
+ return new { Id = _id, Name = objectName }.ToString();
92
93
  #else
93
- return $"{{\"Id\": {_id}}}";
94
+ return new { Id = _id }.ToString();
94
95
  #endif
95
96
  }
96
97
 
@@ -5,10 +5,16 @@
5
5
  using Messages;
6
6
 
7
7
  /// <summary>
8
- /// Description of a general purpose message bus that provides both registration, de-registration, and broadcast capabilities.
8
+ /// Description of a general purpose message bus that provides both registration, deregistration, and broadcast capabilities.
9
9
  /// </summary>
10
10
  public interface IMessageBus
11
11
  {
12
+ public int RegisteredBroadcast { get; }
13
+
14
+ public int RegisteredTargeted { get; }
15
+
16
+ public int RegisteredUntargeted { get; }
17
+
12
18
  /// <summary>
13
19
  /// Given an Untargeted message, determines whether or not it should be processed or skipped
14
20
  /// </summary>
@@ -54,7 +60,7 @@
54
60
  /// </summary>
55
61
  /// <typeparam name="T">Specific type of UntargetedMessages to register for.</typeparam>
56
62
  /// <param name="messageHandler">MessageHandler to register to accept UntargetedMessages of the specified type.</param>
57
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to receive messages.</returns>
63
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to receive messages.</returns>
58
64
  Action RegisterUntargeted<T>(MessageHandler messageHandler, int priority = 0)
59
65
  where T : IUntargetedMessage;
60
66
 
@@ -64,7 +70,7 @@
64
70
  /// <typeparam name="T">Specific type of TargetedMessages to register for.</typeparam>
65
71
  /// <param name="target">Target of messages to listen for.</param>
66
72
  /// <param name="messageHandler">MessageHandler to register the TargetedMessages of the specified type.</param>
67
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to receive the messages.</returns>
73
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to receive the messages.</returns>
68
74
  Action RegisterTargeted<T>(
69
75
  InstanceId target,
70
76
  MessageHandler messageHandler,
@@ -78,7 +84,7 @@
78
84
  /// </summary>
79
85
  /// <typeparam name="T">Specific type of TargetedMessages to register for.</typeparam>
80
86
  /// <param name="messageHandler">MessageHandler to register to accept all TargetedMessages of the specified type.</param>
81
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to receive messages.</returns>
87
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to receive messages.</returns>
82
88
  Action RegisterTargetedWithoutTargeting<T>(MessageHandler messageHandler, int priority = 0)
83
89
  where T : ITargetedMessage;
84
90
 
@@ -88,7 +94,7 @@
88
94
  /// <typeparam name="T">Type of the BroadcastMessage to register.</typeparam>
89
95
  /// <param name="source">InstanceId of the source for BroadcastMessages to listen to.</param>
90
96
  /// <param name="messageHandler">MessageHandler to register to accept BroadcastMessages.</param>
91
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to receive messages.</returns>
97
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to receive messages.</returns>
92
98
  Action RegisterSourcedBroadcast<T>(
93
99
  InstanceId source,
94
100
  MessageHandler messageHandler,
@@ -102,7 +108,7 @@
102
108
  /// </summary>
103
109
  /// <typeparam name="T">Type of the BroadcastMessage to register.</typeparam>
104
110
  /// <param name="messageHandler">MessageHandler to register to accept BroadcastMessages.</param>
105
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to receive messages.</returns>
111
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to receive messages.</returns>
106
112
  Action RegisterSourcedBroadcastWithoutSource<T>(
107
113
  MessageHandler messageHandler,
108
114
  int priority = 0
@@ -114,7 +120,7 @@
114
120
  /// It doesn't matter if the message is Targeted or Untargeted, this MessageHandler will be invoked for it.
115
121
  /// </summary>
116
122
  /// <param name="messageHandler">MessageHandler to register to accept all messages.</param>
117
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to receive messages.</returns>
123
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to receive messages.</returns>
118
124
  Action RegisterGlobalAcceptAll(MessageHandler messageHandler);
119
125
 
120
126
  /// <summary>
@@ -135,7 +141,7 @@
135
141
  /// param1: Current message instance by reference
136
142
  /// And returns: true if message handling should continue, false if message handling should be stopped.
137
143
  /// </note>
138
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to intercept messages.</returns>
144
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to intercept messages.</returns>
139
145
  Action RegisterUntargetedInterceptor<T>(
140
146
  UntargetedInterceptor<T> interceptor,
141
147
  int priority = 0
@@ -160,7 +166,7 @@
160
166
  /// param1: Current message instance by reference
161
167
  /// And returns: true if message handling should continue, false if message handling should be stopped.
162
168
  /// </note>
163
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to intercept messages.</returns>
169
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to intercept messages.</returns>
164
170
  Action RegisterTargetedInterceptor<T>(TargetedInterceptor<T> interceptor, int priority = 0)
165
171
  where T : ITargetedMessage;
166
172
 
@@ -182,7 +188,7 @@
182
188
  /// param1: Current message instance by reference
183
189
  /// And returns: true if message handling should continue, false if message handling should be stopped.
184
190
  /// </note>
185
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to intercept messages.</returns>
191
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to intercept messages.</returns>
186
192
  Action RegisterBroadcastInterceptor<T>(
187
193
  BroadcastInterceptor<T> interceptor,
188
194
  int priority = 0
@@ -190,25 +196,25 @@
190
196
  where T : IBroadcastMessage;
191
197
 
192
198
  /// <summary>
193
- /// Registers the provided MessageHandler to post process Untargeted messages of the given type.
199
+ /// Registers the provided MessageHandler to post-process Untargeted messages of the given type.
194
200
  /// (This will run after all handlers run for the provided message).
195
201
  /// </summary>
196
- /// <typeparam name="T">Type of UntargetedMessage to post process.</typeparam>
197
- /// <param name="messageHandler">MessageHandler to post process messages for.</param>
202
+ /// <typeparam name="T">Type of UntargetedMessage to post-process.</typeparam>
203
+ /// <param name="messageHandler">MessageHandler to post-process messages for.</param>
198
204
  /// <param name="priority">Priority of the interceptor to run at. Handlers run in order of priority from low -> high.</param>
199
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to post process messages.</returns>
205
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to post-process messages.</returns>
200
206
  Action RegisterUntargetedPostProcessor<T>(MessageHandler messageHandler, int priority = 0)
201
207
  where T : IUntargetedMessage;
202
208
 
203
209
  /// <summary>
204
- /// Registers the provided MessageHandler to post process Targeted messages of the given type.
210
+ /// Registers the provided MessageHandler to post-process Targeted messages of the given type.
205
211
  /// (This will run after all handlers run for the provided message).
206
212
  /// </summary>
207
- /// <typeparam name="T">Type of TargetedMessage to post process.</typeparam>
213
+ /// <typeparam name="T">Type of TargetedMessage to post-process.</typeparam>
208
214
  /// <param name="target">Target of messages to listen for.</param>
209
- /// <param name="messageHandler">MessageHandler to post process messages for.</param>
215
+ /// <param name="messageHandler">MessageHandler to post-process messages for.</param>
210
216
  /// <param name="priority">Priority of the interceptor to run at. Handlers run in order of priority from low -> high.</param>
211
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to post process messages.</returns>
217
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to post-process messages.</returns>
212
218
  Action RegisterTargetedPostProcessor<T>(
213
219
  InstanceId target,
214
220
  MessageHandler messageHandler,
@@ -217,13 +223,13 @@
217
223
  where T : ITargetedMessage;
218
224
 
219
225
  /// <summary>
220
- /// Registers the provided MessageHandler to post process Targeted messages of the given type for all targets.
226
+ /// Registers the provided MessageHandler to post-process Targeted messages of the given type for all targets.
221
227
  /// (This will run after all handlers run for the provided message).
222
228
  /// </summary>
223
- /// <typeparam name="T">Type of TargetedMessage to post process.</typeparam>
224
- /// <param name="messageHandler">MessageHandler to post process messages for.</param>
229
+ /// <typeparam name="T">Type of TargetedMessage to post-process.</typeparam>
230
+ /// <param name="messageHandler">MessageHandler to post-process messages for.</param>
225
231
  /// <param name="priority">Priority of the interceptor to run at. Handlers run in order of priority from low -> high.</param>
226
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to post process messages.</returns>
232
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to post-process messages.</returns>
227
233
  Action RegisterTargetedWithoutTargetingPostProcessor<T>(
228
234
  MessageHandler messageHandler,
229
235
  int priority = 0
@@ -231,14 +237,14 @@
231
237
  where T : ITargetedMessage;
232
238
 
233
239
  /// <summary>
234
- /// Registers the provided MessageHandler to post process Targeted messages of the given type.
240
+ /// Registers the provided MessageHandler to post-process Targeted messages of the given type.
235
241
  /// (This will run after all handlers run for the provided message).
236
242
  /// </summary>
237
- /// <typeparam name="T">Type of TargetedMessage to post process.</typeparam>
243
+ /// <typeparam name="T">Type of TargetedMessage to post-process.</typeparam>
238
244
  /// <param name="source">Source of messages to listen for.</param>
239
- /// <param name="messageHandler">MessageHandler to post process messages for.</param>
245
+ /// <param name="messageHandler">MessageHandler to post-process messages for.</param>
240
246
  /// <param name="priority">Priority of the interceptor to run at. Handlers run in order of priority from low -> high.</param>
241
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to post process messages.</returns>
247
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to post-process messages.</returns>
242
248
  Action RegisterBroadcastPostProcessor<T>(
243
249
  InstanceId source,
244
250
  MessageHandler messageHandler,
@@ -247,13 +253,13 @@
247
253
  where T : IBroadcastMessage;
248
254
 
249
255
  /// <summary>
250
- /// Registers the provided MessageHandler to post process Targeted messages of the given type for all sources.
256
+ /// Registers the provided MessageHandler to post-process Targeted messages of the given type for all sources.
251
257
  /// (This will run after all handlers run for the provided message).
252
258
  /// </summary>
253
- /// <typeparam name="T">Type of TargetedMessage to post process.</typeparam>
254
- /// <param name="messageHandler">MessageHandler to post process messages for.</param>
259
+ /// <typeparam name="T">Type of TargetedMessage to post-process.</typeparam>
260
+ /// <param name="messageHandler">MessageHandler to post-process messages for.</param>
255
261
  /// <param name="priority">Priority of the interceptor to run at. Handlers run in order of priority from low -> high.</param>
256
- /// <returns>The de-registration action. Should be invoked when the handler no longer wants to post process messages.</returns>
262
+ /// <returns>The deregistration action. Should be invoked when the handler no longer wants to post-process messages.</returns>
257
263
  Action RegisterBroadcastWithoutSourcePostProcessor<T>(
258
264
  MessageHandler messageHandler,
259
265
  int priority = 0
@@ -2118,7 +2118,10 @@
2118
2118
  }
2119
2119
  else
2120
2120
  {
2121
- messageHandlers.AddRange(handlers);
2121
+ foreach (KeyValuePair<int, SortedList<MessageHandler, int>> handler in handlers)
2122
+ {
2123
+ messageHandlers.Add(handler);
2124
+ }
2122
2125
  }
2123
2126
  return messageHandlers;
2124
2127
  }
@@ -2174,7 +2177,10 @@
2174
2177
  }
2175
2178
  default:
2176
2179
  {
2177
- messageHandlers.AddRange(handlers);
2180
+ foreach (MessageHandler handler in handlers)
2181
+ {
2182
+ messageHandlers.Add(handler);
2183
+ }
2178
2184
  break;
2179
2185
  }
2180
2186
  }